Config
A configuration object. Acts a little like a dictionary, but not really.
The Config class is accessible via the initools.configwrapper module.
Configuration can be nested with [section] markers, or can be flat (everything globally available). If in sections then section.key is used, otherwise just key.
Attributes
Methods
f __init__(self, filename, file=None, allow_empty_sections=<class initools.configwrapper.NoDefault at 0xb74dd02c>) ...
f get(self, key, default=None, section=None) ...
Get a single value, returning default if none found.
f getlist(self, key, default=(), section=None) ...
Get a list of all matching keys. Example:
- foo = bar
- foo = baz
Then:
>>> config.getlist('foo')
['bar', 'baz']
f getbool(self, key, default=False, section=None) ...
Get a single boolean value. Boolean values are things like true, false, etc.
f getinlinelist(self, key, default=(), section=None) ...
Get a list, where the list is defined like:
foo = bar, baz
Gives:
>>> config.getinlinelist('foo')
['bar', 'baz']
f getstartswith(self, startswith, section) ...
Returns a list of [(key, value), ...] for all keys in the section that start with startswith.
See the source for more information.