Package svnmailer :: Module config :: Class ConfigFileSettings
[show private | hide private]
[frames | no frames]

Class ConfigFileSettings

object --+    
         |    
  Settings --+
             |
            ConfigFileSettings


Provide settings from config
Method Summary
  init(self, *args, **kwargs)
Implements the init method of settings.Settings
ConfigParser.ConfigParser _getConfig(self, options)
Parse config file
list _getDefaultConfigFiles(self, options)
Returns the default config files
  _init(self, options)
Actual implementation of self.init()
  _passConfig(self, container, section)
Pass the options to the specified container
    Inherited from Settings
  __init__(self, *args, **kwargs)
Constructor
_GeneralSettingsContainer getGeneralContainer(self, **kwargs)
Returns an initialized general settings container
_GroupSettingsContainer getGroupContainer(self, **kwargs)
Returns an initialized group settings container
_RuntimeSettingsContainer getRuntimeContainer(self, **kwargs)
Returns an initialized runtime settings container
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __repr__(x)
x.__repr__() <==> repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...
  __str__(x)
x.__str__() <==> str(x)...
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...

Instance Variable Summary
ConfigParser.ConfigParser _config: The config object
    Inherited from Settings
bool debug: Debug state
_GeneralSettingsContainer general: General settings
list of _GroupSettingsContainer groups: group settings list
_RuntimeSettingsContainer runtime: Runtime settigs

Class Variable Summary
type __implements__ = svnmailer.settings.Settings

Method Details

init(self, *args, **kwargs)

Implements the init method of settings.Settings
Raises:
ConfigInvalidError - invalid config options
ConfigMissingError - see _getConfig
ConfigNotFoundError - see _getConfig
ConfigSectionNotFoundError - see _passConfig
ConfigOptionUnkownError - see _passConfig
Overrides:
svnmailer.settings.Settings.init

_getConfig(self, options)

Parse config file
Parameters:
options - commandline options
           (type=optparse.OptionParser)
Returns:
parsed config
           (type=ConfigParser.ConfigParser)
Raises:
ConfigMissingError - config neither specified nor on default locations found. Default locations are (tried in that order):
  • <repos>/conf/mailer.conf
  • <scriptdir>/mailer.conf
  • /etc/svn-mailer.conf
ConfigNotFoundError - sepcified configfile could not be opened

_getDefaultConfigFiles(self, options)

Returns the default config files
Parameters:
options - command line options
           (type=optparse.OptionParser)
Returns:
The list
           (type=list)

_init(self, options)

Actual implementation of self.init()
Parameters:
options - runtime options
           (type=optparse.OptionParser)
Raises:
ConfigMissingError - see _getConfig
ConfigNotFoundError - see _getConfig
ConfigSectionNotFoundError - see _passConfig
ConfigOptionUnkownError - see _passConfig

_passConfig(self, container, section)

Pass the options to the specified container
Parameters:
container - The container object
           (type=svnmailer.util.Struct)
section - The config section name
           (type=str)
Raises:
ConfigSectionNotFoundError - The specified section was not found in the config file
ConfigOptionUnkownError - There was an unknown config option in the config file. This exception is only thrown in debug mode.

Instance Variable Details

_config

The config object
Type:
ConfigParser.ConfigParser

Generated by Epydoc 2.0 on Mon Feb 14 16:49:17 2005 http://epydoc.sf.net