Package svnmailer :: Package settings :: Module _base :: Class BaseSettings
[show private | hide private]
[frames | no frames]

Class BaseSettings

object --+
         |
        BaseSettings

Known Subclasses:
ConfigFileSettings

Settings management

Note: The init method must be overridden to do the actual initialization.

Method Summary
  __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
  init(self)
Abstract custom initializer
    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
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
str _DEFAULT_CHARSET: The default settings charset
    Section Names
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
    Settings Containers Classes
_typedstruct.Struct _GENERAL_CONTAINER = svnmailer.settings._base.GeneralSettingsContainer
_typedstruct.Struct _GROUP_CONTAINER = svnmailer.settings._base.GroupSettingsContainer
_typedstruct.Struct _RUNTIME_CONTAINER = svnmailer.settings._base.RuntimeSettingsContainer

Method Details

__init__(self, options, members, typemap, mappers)
(Constructor)

Constructor

Don't override this one. Override init instead.

Parameters:
options - runtime options
           (type=optparse.OptionContainer)
members - The member definitions
           (type=dict)
typemap - The member type descriptors
           (type=dict)
mappers - The map finder classes
           (type=sequence)
Overrides:
__builtin__.object.__init__

_checkInitialization(self)

Checks if all containers are filled
Raises:
AssertionError - A config was not initialized

_createCreators(self, members, typemap)

Returns new container creator instances
Parameters:
members - The member definitions
           (type=dict)
typemap - The member type descriptors
           (type=dict)
Returns:
The container creators
           (type=dict)

_createDefaultGroupContainer(self, **kwargs)

Returns an initialized default group settings container
Parameters:
kwargs - Initial settings
Returns:
A new GroupSettingsContainer instance (with maps disabled)
           (type=GroupSettingsContainer)

_createGeneralContainer(self, **kwargs)

Returns an initialized general settings container
Parameters:
kwargs - Initial settings
Returns:
A new GeneralSettingsContainer instance
           (type=GeneralSettingsContainer)

_createGroupContainer(self, **kwargs)

Returns an initialized group settings container
Parameters:
kwargs - Initial settings
Returns:
A new GroupSettingsContainer instance
           (type=GroupSettingsContainer)

_createMapFinder(self, config)

Returns a map finder
Parameters:
config - The config object
           (type=BaseConfig)
Returns:
A new MapFinder instance
           (type=MapFinder)

_createRuntimeContainer(self, **kwargs)

Returns an initialized runtime settings container

Note that the runtime settings (from commandline) are always assumed to be utf-8 encoded.

Parameters:
kwargs - Initial settings
Returns:
A new RuntimeSettingsContainer instance
           (type=RuntimeSettingsContainer)

_initRuntime(self, options)

Initializes the runtime from options
Parameters:
options - runtime options
           (type=optparse.OptionParser)
Returns:
A new runtime container, filled from options
           (type=RuntimeSettingsContainer)

init(self)

Abstract custom initializer

Instance Variable Details

_charset

The charset used for settings recoding
Type:
str

_creators

The container creator classes ({'general': creator1, 'group': creator2, 'runtime': creator3})
Type:
dict

_fcharset

The charset used for filename recoding
Type:
str

_mappers

The map finder classes ([class, ...])
Type:
sequence

_maps

The value mappers to use or None
Type:
dict

general

General settings container
Type:
GeneralSettingsContainer

groups

group settings list ([GroupSettingsContainer(), ...])
Type:
list

runtime

Runtime settigs container
Type:
RuntimeSettingsContainer

Class Variable Details

_DEFAULT_CHARSET

The default settings charset
Type:
str
Value:
'us-ascii'                                                             

DEFAULTSECTION

The name of the [defaults] section
Type:
unicode
Value:
u'defaults'                                                            

GENERALSECTION

The name of the [general] section
Type:
unicode
Value:
u'general'                                                             

MAPSECTION

The mapping section name; if None, mapping is effectively disabled
Type:
unicode
Value:
u'maps'                                                                

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