Package mathbench :: Package basement :: Module configuration :: Class MathBenchConfig
[hide private]

Class MathBenchConfig

source code

ConfigParser.RawConfigParser --+        
                               |        
       ConfigParser.ConfigParser --+    
                                   |    
       ConfigParser.SafeConfigParser --+
                                       |
                                      MathBenchConfig

Hold the configuration for the whole application and makes it possible to save the default and prefered options of the users.

It is implemented as a singleton.



Instance Methods [hide private]
 
__init__(self)
Save the default if the file does not exists, else just read it.
source code
 
save(self)
Write the config in the file
source code

Inherited from ConfigParser.SafeConfigParser: set

Inherited from ConfigParser.SafeConfigParser (private): _interpolate, _interpolate_some, _interpvar_match

Inherited from ConfigParser.ConfigParser: get, items

Inherited from ConfigParser.ConfigParser (private): _interpolation_replace

Inherited from ConfigParser.RawConfigParser: add_section, defaults, getboolean, getfloat, getint, has_option, has_section, options, optionxform, read, readfp, remove_option, remove_section, sections, write

Inherited from ConfigParser.RawConfigParser (private): _get, _read

Static Methods [hide private]
 
setFilePath(filepath)
Set the config file's path.
source code
 
getConfig()
Return the singleton's instance
source code
Class Variables [hide private]
  __instance = None
  _filepath = '.config'

Inherited from ConfigParser.ConfigParser (private): _KEYCRE

Inherited from ConfigParser.RawConfigParser: OPTCRE, SECTCRE

Inherited from ConfigParser.RawConfigParser (private): _boolean_states

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Save the default if the file does not exists, else just read it. filepath should the the full path to the file (base + name)
Overrides: ConfigParser.RawConfigParser.__init__

setFilePath(filepath)
Static Method

source code 
Set the config file's path. To be called before any initialisation.