Thin layer over ConfigParser from the Python standard library.
In addition to providing some convenience methods, the class remembers
the last modification time of the configuration file, and reparses it
when the file has changed.
|
|
__init__(self,
filename,
params={})
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
|
__contains__(self,
name)
Return whether the configuration contains a section of the given
name. |
source code
|
|
|
|
__getitem__(self,
name)
Return the configuration section with the specified name. |
source code
|
|
|
|
|
|
|
get(self,
section,
key,
default='')
Return the value of the specified option. |
source code
|
|
|
|
getbool(self,
section,
key,
default='')
Return the specified option as boolean value. |
source code
|
|
|
|
getint(self,
section,
key,
default='')
Return the value of the specified option as integer. |
source code
|
|
|
|
getfloat(self,
section,
key,
default='')
Return the value of the specified option as float. |
source code
|
|
|
|
getlist(self,
section,
key,
default='',
sep=',',
keep_empty=False)
Return a list of values that have been specified as a single
comma-separated option. |
source code
|
|
|
|
getpath(self,
section,
key,
default='')
Return a configuration value as an absolute path. |
source code
|
|
|
|
set(self,
section,
key,
value)
Change a configuration value. |
source code
|
|
|
|
defaults(self,
compmgr=None)
Returns a dictionary of the default configuration values
(''since 0.10''). |
source code
|
|
|
|
options(self,
section,
compmgr=None)
Return a list of (name, value) tuples for every option in the
specified section. |
source code
|
|
|
|
remove(self,
section,
key)
Remove the specified option. |
source code
|
|
|
|
|
|
|
has_option(self,
section,
option,
defaults=True)
Returns True if option exists in section in either the project
trac.ini or one of the parents, or is available through the Option
registry. |
source code
|
|
|
|
save(self)
Write the configuration options to the primary file. |
source code
|
|
|
|
|
|
|
|
|
|
set_defaults(self,
compmgr=None)
Retrieve all default values and store them explicitly in the
configuration, so that they can be saved to file. |
source code
|
|
|
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__,
__sizeof__,
__str__,
__subclasshook__
|