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

Class ConfigFileSettings

  object --+    
           |    
BaseSettings --+
               |
              ConfigFileSettings


Provide settings from config
Method Summary
FileConfig _createFileConfig(self)
Returns a loaded config file object
_base.GeneralSettingsContainer _extractGeneralSection(self, config)
Extracts the general config
list _extractGroupSections(self, config)
Extracts the group configurations
dict _extractMapSections(self, config)
Returns the map definitions
tuple _getGroupDefaults(self, config)
Returns the default groups container
_typedstruct.Struct _passConfig(self, config, container, section)
Passes the options to the specified container
  init(self)
Implements _base.BaseSettings.init
    Inherited from BaseSettings
  __init__(self, options, members, typemap, mappers)
Constructor
  _checkInitialization(self)
Checks if all containers are filled
dict _createCreators(self, members, typemap)
Returns new container creator instances
GroupSettingsContainer _createDefaultGroupContainer(self, **kwargs)
Returns an initialized default group settings container
GeneralSettingsContainer _createGeneralContainer(self, **kwargs)
Returns an initialized general settings container
GroupSettingsContainer _createGroupContainer(self, **kwargs)
Returns an initialized group settings container
MapFinder _createMapFinder(self, config)
Returns a map finder
RuntimeSettingsContainer _createRuntimeContainer(self, **kwargs)
Returns an initialized runtime settings container
RuntimeSettingsContainer _initRuntime(self, options)
Initializes the runtime from options
    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
    Inherited from BaseSettings
str _charset: The charset used for settings recoding
dict _creators: The container creator classes ({'general': creator1, 'group': creator2, 'runtime': creator3})
str _fcharset: The charset used for filename recoding
sequence _mappers: The map finder classes ([class, ...])
dict _maps: The value mappers to use or None
GeneralSettingsContainer general: General settings container
list groups: group settings list ([GroupSettingsContainer(), ...])
RuntimeSettingsContainer runtime: Runtime settigs container

Class Variable Summary
list __implements__ = [<class 'svnmailer.settings._base.BaseS...
Exception _PARSEERROR = svnmailer.settings._fileparser.Error
    Inherited from BaseSettings
str _DEFAULT_CHARSET: The default settings charset
unicode DEFAULTSECTION: The name of the [defaults] section
unicode GENERALSECTION: The name of the [general] section
unicode MAPSECTION: The mapping section name; if None, mapping is effectively disabled

Method Details

_createFileConfig(self)

Returns a loaded config file object
Returns:
A new FileConfig instance
           (type=FileConfig)
Raises:
ConfigInvalidError - Config format error

_extractGeneralSection(self, config)

Extracts the general config
Parameters:
config - The FileConfig instance
           (type=FileConfig)
Returns:
A new GeneralSettingsContainer
           (type=_base.GeneralSettingsContainer)
Raises:
ConfigSectionNotFoundError - [general] not found
ConfigOptionUnkownError - There was an unknown config option in the file.

_extractGroupSections(self, config)

Extracts the group configurations
Parameters:
config - The FileConfig instance
           (type=FileConfig)
Returns:
The group sections ([container, ...])
           (type=list)
Raises:
ConfigOptionUnkownError - There was an unknown config option in the file.

_extractMapSections(self, config)

Returns the map definitions
Parameters:
config - The FileConfig instance
           (type=FileConfig)
Returns:
The mapper table ({'option': mapper, ...})
           (type=dict)
Raises:
ConfigMappingSpecInvalidError - The mapping spec was invalid

To Do: raise an error on unknown options

_getGroupDefaults(self, config)

Returns the default groups container
Parameters:
config - The FileConfig instance
           (type=FileConfig)
Returns:
The defaults (groupcontainer without maps) as container and dict ((_base.GroupSettingsContainer, dict))
           (type=tuple)

_passConfig(self, config, container, section)

Passes the options to the specified container
Parameters:
config - The FileConfig instance
           (type=FileConfig)
container - The container object to fill
           (type=_typedstruct.Struct)
section - The config section name
           (type=str)
Returns:
The container again (convenience return)
           (type=_typedstruct.Struct)
Raises:
ConfigSectionNotFoundError - The specified section was not found in the config file
ConfigOptionUnkownError - There was an unknown config option in the file.

init(self)

Implements _base.BaseSettings.init
Raises:
Error - Some error occured
Overrides:
svnmailer.settings._base.BaseSettings.init

Class Variable Details

__implements__

Type:
list
Value:
[<class 'svnmailer.settings._base.BaseSettings'>]                      

Generated by Epydoc 2.0 on Sun Sep 25 20:49:20 2005 http://epydoc.sf.net