A collection of config Sections and provides an interface to access
them and their items.
You construct it with the Sections you want and then use the get
method to access their content. You can either use get(section, name) or
just get(name), which implies the defaultSection section defined at the
top (right now, "general").
To read configuration items, use addFromFp. addFromFp should only
raise subclasses of ConfigError.
You can also set individual items using set.
The class follows the default behaviour of configparser in that
section and item names are lowercased.
Note that direct access to sections is not forbidden, but you have to
keep case mangling of keys into account when doing so.
|
__init__(self,
*sections)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
|
|
getitem(self,
arg1,
arg2=None)
returns the *item* described by section, name or just name. |
source code
|
|
|
get(self,
arg1,
arg2=None,
default=<class 'gavo.utils.fancyconfig._Undefined'>) |
source code
|
|
|
set(self,
arg1,
arg2,
arg3=None,
origin=' user ' )
sets a configuration item to a value. |
source code
|
|
|
addFromFp(self,
fp,
origin=' user ' ,
fName=' <internal> ' )
adds the config items in the file fp to self. |
source code
|
|
|
getUserConfig(self)
returns a configparser containing the user set config items. |
source code
|
|
|
saveUserConfig(self,
destName)
writes the config items changed by the user to destName. |
source code
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|