Package qm :: Module common :: Class RcConfiguration
[show private | hide private]
[frames | no frames]

Class RcConfiguration

RawConfigParser --+    
                  |    
       ConfigParser --+
                      |
                     RcConfiguration


Interface object to QM configuration files.

Configuration files are in the format parsed by the standard 'ConfigParser' module, namely 'win.ini'--style files.
Method Summary
  __init__(self)
Create a new configuration instance.
  Get(self, option, default, section)
Retrieve a configuration variable.
  GetOptions(self, section)
Return a sequence of options.
  Load(self, section)
Load configuration.
    Inherited from ConfigParser
  get(self, section, option, raw, vars)
Get an option value for a given section.
  items(self, section, raw, vars)
Return a list of tuples with (name, value) for each option in the section.
    Inherited from RawConfigParser
  add_section(self, section)
Create a new section in the configuration.
  defaults(self)
  getboolean(self, section, option)
  getfloat(self, section, option)
  getint(self, section, option)
  has_option(self, section, option)
Check for the existence of a given option in a given section.
  has_section(self, section)
Indicate whether the named section is present in the configuration.
  options(self, section)
Return a list of option names for the given section name.
  optionxform(self, optionstr)
  read(self, filenames)
Read and parse a filename or a list of filenames.
  readfp(self, fp, filename)
Like read() but the argument must be a file-like object.
  remove_option(self, section, option)
Remove an option.
  remove_section(self, section)
Remove a file section.
  sections(self)
Return a list of section names, excluding [DEFAULT]
  set(self, section, option, value)
Set an option.
  write(self, fp)
Write an .ini-format representation of the configuration state.

Class Variable Summary
str user_rc_file_name = '.qmrc'
    Inherited from RawConfigParser
SRE_Pattern OPTCRE = ([^:=\s][^:=]*)\s*([:=])\s*(.*)$
SRE_Pattern SECTCRE = \[([^\]]+)\]

Method Details

__init__(self)
(Constructor)

Create a new configuration instance.
Overrides:
ConfigParser.RawConfigParser.__init__

Get(self, option, default, section=None)

Retrieve a configuration variable.

'option' -- The name of the option to retrieve.

'default' -- The default value to return if the option is not found.

'section' -- The section from which to retrieve the option. 'None' indicates the section specified to the 'Load' method for this instance.

precondition -- The RC configuration must be loaded.

GetOptions(self, section=None)

Return a sequence of options.

'section' -- The section for which to list options, or 'None' for the section specified to 'Load'.

precondition -- The RC configuration must be loaded.

Load(self, section)

Load configuration.

'section' -- The configuration section from which subsequent variables are loaded.

Class Variable Details

user_rc_file_name

Type:
str
Value:
'.qmrc'                                                                

Generated by Epydoc 2.1 on Thu Sep 27 15:49:06 2007 http://epydoc.sf.net