Method summary
- __init__(self, configClass, configFilename, filePriority = True)
- fconfStr(self)
- fconfUpdate(self, fconf, tconf)
- tconfStr(self)
- write(self, filename = None)
- writeAll(self, filename = None)
Methods
- __init__(self, configClass, configFilename, filePriority = True)
Make a new TConfigManager.
Parameters: configClass : class
- configFilename : string
- If the filename points to a non-existent file, it will be created empty. This is useful when creating a file form from an existing configClass with the class defaults.
Keywords: filePriority : bool (True)
If true, at construction time the file object takes priority and overwrites the contents of the config object. Else, the data flow is reversed and the file object will be overwritten with the configClass defaults at write() time.
- fconfStr(self)
- fconfUpdate(self, fconf, tconf)
Update the fconf object with the data from tconf
- tconfStr(self)
- write(self, filename = None)
Write out to disk.
This method writes out only to the top file in a hierarchical configuration, which means that the class defaults and other values not explicitly set in the top level file are NOT written out.
Keywords: - filename : string (None)
- If given, the output is written to this file, otherwise the .filename attribute of the top-level configuration object is used.
- writeAll(self, filename = None)
Write out the entire configuration to disk.
This method, in contrast with write(), updates the .fconfCombined object with the entire .tconf instance, and then writes it out to disk. This method is thus useful for generating files that have a self-contained, non-hierarchical file.
Keywords: - filename : string (None)
- If given, the output is written to this file, otherwise the .filename attribute of the top-level configuration object is used.