Home | Trees | Index | Help |
|
---|
Package Cheetah :: Module SettingsManager :: Class SettingsManager |
|
_SettingsCollector
--+
|
SettingsManager
ModuleCompiler
A mixin class that provides facilities for managing application settings.
SettingsManager is designed to work well with nested settings dictionaries of any depth.
Method Summary | |
---|---|
MUST BE CALLED BY SUBCLASSES | |
Returns a shallow copy of the settings dictionary | |
Returns a deep copy of the settings dictionary | |
Return a string with the settings in .ini file format. | |
True/False | |
Set a setting in self._settings. | |
Get a setting from self._settings, with or without a default value. | |
Return a reference to the settings dictionary | |
Update the settings with a selective merge or a complete overwrite. | |
Update the settings from a text file using the syntax accepted by Python's standard ConfigParser module (like Windows .ini files). | |
See the docstring for .updateSettingsFromConfigFile() | |
See the docstring for .updateSettingsFromConfigFile() | |
Update the settings from variables in a Python source file. | |
Update the settings from a code in a Python src string. | |
Write all the settings that can be represented as strings to an .ini style config file. | |
Write all the settings that can be represented as strings to an .ini style config string. | |
_defaultSettings(self)
| |
A hook that allows for complex setting initialization sequences that involve references to 'self' or other settings. | |
Inherited from _SettingsCollector | |
Extract all the attributes of a SettingsContainer subclass. | |
Check if 'thing' is a Python module or a subclass of SettingsContainer. | |
A hook for any neccessary path manipulations. | |
| |
Return the settings from a config file that uses the syntax accepted by Python's standard ConfigParser module (like Windows .ini files). | |
Returns all settings from a SettingsContainer or Python module. | |
Returns all settings from a SettingsContainer or Python module. | |
Return new settings dict from variables in a Python source file. | |
Return a dictionary of the settings in a Python src string. |
Class Variable Summary | |
---|---|
Inherited from _SettingsCollector | |
lock |
_sysPathLock = <thread.lock object at 0xb7e5a560>
|
Method Details |
---|
__init__(self)
MUST BE CALLED BY SUBCLASSES
|
copySettings(self)Returns a shallow copy of the settings dictionary |
deepcopySettings(self)Returns a deep copy of the settings dictionary |
getConfigString(self)Return a string with the settings in .ini file format. |
hasSetting(self, key)True/False |
setSetting(self, name, value)Set a setting in self._settings. |
setting(self, name, default=<class Cheetah.SettingsManager.NoDefault at 0xb6a87c2c>)Get a setting from self._settings, with or without a default value. |
settings(self)Return a reference to the settings dictionary |
updateSettings(self, newSettings, merge=True)Update the settings with a selective merge or a complete overwrite. |
updateSettingsFromConfigFile(self, path, **kw)Update the settings from a text file using the syntax accepted by Python's standard ConfigParser module (like Windows .ini files). |
updateSettingsFromConfigFileObj(self, inFile, convert=True, merge=True)See the docstring for .updateSettingsFromConfigFile() The caller of this method is responsible for closing the inFile file object. |
updateSettingsFromConfigStr(self, configStr, convert=True, merge=True)See the docstring for .updateSettingsFromConfigFile() |
updateSettingsFromPySrcFile(self, path, merge=True)Update the settings from variables in a Python source file. This method will temporarily add the directory of src file to sys.path so that import statements relative to that dir will work properly. |
updateSettingsFromPySrcStr(self, theString, merge=True)Update the settings from a code in a Python src string. |
writeConfigFile(self, path)Write all the settings that can be represented as strings to an .ini style config file. |
_createConfigFile(self, outFile=None)Write all the settings that can be represented as strings to an .ini style config string. This method can only handle one level of nesting and will only work with numbers, strings, and None. |
_initializeSettings(self)A hook that allows for complex setting initialization sequences that involve references to 'self' or other settings. For example: self._settings['myCalcVal'] = self._settings['someVal'] * 15 This method should be called by the class' __init__() method when needed. The dummy implementation should be reimplemented by subclasses. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sat Mar 4 13:36:27 2006 | http://epydoc.sf.net |