Inheritance diagram for IPython.config.loader:
A simple configuration system.
Bases: IPython.config.loader.CommandLineConfigLoader
A loader that uses the argparse module to load from the command line.
Create a config loader for use with argparse.
Parameters : | argv : optional, list
parser_args : tuple
parser_kw : dict
|
---|---|
Returns : | config : Config
|
Parse command line arguments and return as a Config object.
Parameters : | args : optional, list
|
---|
Bases: IPython.config.loader.ConfigLoaderError
x.__init__(...) initializes x; see help(type(x)) for signature
Bases: argparse.ArgumentParser
Simple argparse subclass that prints help to stdout by default.
Prints a usage message incorporating the message to stderr and exits.
If you override this in a subclass, it should not return – it should either exit or raise an exception.
Bases: IPython.config.loader.ConfigLoader
A config loader for command line arguments.
As we add more command line based loaders, the common logic should go here.
A base class for config loaders.
Examples
>>> cl = ConfigLoader()
>>> config = cl.load_config()
>>> config
{}
Load a config from somewhere, return a Config instance.
Usually, this will cause self.config to be set and then returned. However, in most cases, ConfigLoader.clear() should be called to erase any previous state.
Bases: dict
An attribute based dict that can do smart merges.
v defaults to None.
If key is not found, d is returned if given, otherwise KeyError is raised
2-tuple; but raise KeyError if D is empty.
If E has a .keys() method, does: for k in E: D[k] = E[k] If E lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
Bases: IPython.config.loader.ConfigError
x.__init__(...) initializes x; see help(type(x)) for signature
Bases: object
A object for loading configurations from just about anywhere.
The resulting configuration is packaged as a Struct.
Notes
A ConfigLoader does one thing: load a config from a source (file, command line arguments) and returns the data as a Struct. There are lots of things that ConfigLoader does not do. It does not implement complex logic for finding config files. It does not handle default values or merge multiple configs. These things need to be handled elsewhere.
A base class for config loaders.
Examples
>>> cl = ConfigLoader()
>>> config = cl.load_config()
>>> config
{}
Load a config from somewhere, return a Config instance.
Usually, this will cause self.config to be set and then returned. However, in most cases, ConfigLoader.clear() should be called to erase any previous state.
Bases: IPython.config.loader.ConfigError
x.__init__(...) initializes x; see help(type(x)) for signature
Bases: IPython.config.loader.ConfigLoader
A base class for file based configurations.
As we add more file based config loaders, the common logic should go here.
A base class for config loaders.
Examples
>>> cl = ConfigLoader()
>>> config = cl.load_config()
>>> config
{}
Load a config from somewhere, return a Config instance.
Usually, this will cause self.config to be set and then returned. However, in most cases, ConfigLoader.clear() should be called to erase any previous state.
Bases: IPython.config.loader.ArgParseConfigLoader
A config loader that loads aliases and flags with argparse, but will use KVLoader for the rest. This allows better parsing of common args, such as ipython -c ‘print 5’, but still gets arbitrary config with ipython –InteractiveShell.use_readline=False
Create a config loader for use with argparse.
Parameters : | argv : optional, list
parser_args : tuple
parser_kw : dict
|
---|---|
Returns : | config : Config
|
Parse command line arguments and return as a Config object.
Parameters : | args : optional, list
|
---|
Bases: IPython.config.loader.CommandLineConfigLoader
A config loader that loads key value pairs from the command line.
This allows command line options to be gives in the following form:
ipython --profile="foo" --InteractiveShell.autocall=False
Create a key value pair config loader.
Parameters : | argv : list
aliases : dict
flags : dict
|
---|---|
Returns : | config : Config
|
Examples
>>> from IPython.config.loader import KeyValueConfigLoader
>>> cl = KeyValueConfigLoader()
>>> d = cl.load_config(["--A.name='brian'","--B.number=0"])
>>> sorted(d.items())
[('A', {'name': 'brian'}), ('B', {'number': 0})]
Parse the configuration and generate the Config object.
After loading, any arguments that are not key-value or flags will be stored in self.extra_args - a list of unparsed command-line arguments. This is used for arguments such as input files or subcommands.
Parameters : | argv : list, optional
aliases : dict
flags : dict
|
---|
Bases: IPython.config.loader.FileConfigLoader
A config loader for pure python files.
This calls execfile on a plain python file and looks for attributes that are all caps. These attribute are added to the config Struct.
Build a config loader for a filename and path.
Parameters : | filename : str
path : str, list, tuple
|
---|
Load the config from a file and return it as a Struct.
Load multiple Python config files, merging each of them in turn.
Parameters : | config_files : list of str
path : unicode
|
---|