Package turbogears :: Module config

Module config

source code

Functions
 
update_config(configfile=None, modulename=None)
Update the system configuration from given config file and/or module.
source code
 
get(key, default_value=None, return_section=False, path=None)
Return config value with setting name given by 'key'.
source code
 
update(configvalues)
Update the configuration with the values from the dictionary.
source code
Function Details

update_config(configfile=None, modulename=None)

source code 

Update the system configuration from given config file and/or module.

'configfile' is a ConfigObj (INI-style) config file, 'modulename' a module path in dotted notation. The function looks for files with a ".cfg" extension if the given module name refers to a package directory or a file with the base name of the right-most part of the module path and a ".cfg" extension added.

If both 'configfile' and 'modulname' are specified, the module is read first, followed by the config file. This means that the config file's options override the options in the module file.

get(key, default_value=None, return_section=False, path=None)

source code 

Return config value with setting name given by 'key'.

If the config setting is unset, return given 'default_value' instead. If 'return_section' is specified, return the path to the value, instead of the value itself. If 'path' is specified, return the the value of the setting in the context of the given URL path or below.