Package svnmailer :: Package settings :: Class Manager
[show private | hide private]
[frames | no frames]

Class Manager

object --+    
         |    
 Singleton --+
             |
            Manager


Svnmailer settings manager
Method Summary
_base.BaseSettings loadSettings(self, options)
Loads the settings using the registered loader
  registerLoader(self, classname)
Registers a new settings loader
  registerMapper(self, classname)
Registers a new mapper class
  registerOption(self, category, name, spec, aliases, compare)
Registers a new configuration option
  registerType(self, name, classname)
Registers a new member type
  _load(self, classname)
Loads the class specified by classname
    Inherited from Singleton
  __init__(self)
Non-initialization
  __new__(cls)
Returns the one and only instance (Static method)
    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)...

Class Variable Summary
str _LOADER: The settings loader.
list _MAPPERS: The list of mapper classes.
dict _MEMBERS: The member definitions of the configuration sections.
dict _TYPEMAP: The mapping of all available type names to their actual implementation classes.
module _util: The util module
    Inherited from Singleton
NoneType __singletoninstance__ = None                                                                  

Instance Method Details

loadSettings(self, options)

Loads the settings using the registered loader
Parameters:
options - runtime options
           (type=optparse.OptionContainer)
Returns:
A new _base.BaseSettings instance
           (type=_base.BaseSettings)
Raises:
Error - A settings error occured
ImportError - A class could not be loaded

registerLoader(self, classname)

Registers a new settings loader
Parameters:
classname - The fully qualified class name (e.g. 'svnmailer.settings.configfile.ConfigFileSettings')
           (type=str)

registerMapper(self, classname)

Registers a new mapper class
Parameters:
classname - The fully qualified class name (e.g. 'svnmailer.settings.mappers.PlainMapper')
           (type=str)

registerOption(self, category, name, spec=None, aliases=None, compare=True)

Registers a new configuration option
Parameters:
category - The configuration category where the option should be recognized. Valid values are general, group and runtime. Modifying the latter is not so useful though.
           (type=str)
name - The name of the option (like 'cia_project_path')
           (type=str)
spec - The member specification. Generally this is a tuple, with two items: ('descriptor', {specdict}). If specdict is empty, the descriptor string is sufficient. If no specific descriptor is needed, None may be used.
           (type=tuple or str)
aliases - Alias names for this member (('alias', ...))
           (type=sequence)
compare - Does the option needs to be included in the comparison of different group sections (while compressing notification groups) (In other words -- does it affect the mail/news subject or body in any way)? Setting to False is only valid if category is group.
           (type=bool)
Raises:
KeyError - The category was invalid

registerType(self, name, classname)

Registers a new member type
Parameters:
name - The name of the type. It is case sensitive.
           (type=str)
classname - The fully qualified class name (e.g. 'svnmailer.settings._accessors.UnicodeMember')
           (type=str)

_load(self, classname)

Loads the class specified by classname
Parameters:
classname - The classname to load
           (type=str)
Raises:
ImportError - The import of the class failed

Class Variable Details

_LOADER

The settings loader. It should be modified by the registerLoader method only and is also a fully qualified class name. Note that each registerLoader call overrides the previous one.
Type:
str
Value:
'svnmailer.settings.configfile.ConfigFileSettings'                     

_MAPPERS

The list of mapper classes. It should be modified by the registerMapper method only. The classes are expressed by their fully qualified names in string form (like 'svnmailer.settings.mappers.PlainMapper'). The list is initially filled with the builtin mapper classes.
Type:
list
Value:
['svnmailer.settings.mappers.PlainMapper']                             

_MEMBERS

The member definitions of the configuration sections. Use registerOption to modifiy it.
Type:
dict
Value:
{'general': {'aliases': {'diff': 'diff_command',
                         'mail_command': 'sendmail_command',
                         'smtp_hostname': 'smtp_host'},
             'members': {'cia_rpc_server': ('unicode', {'map': True}),
                         'debug_all_mails_to': ('tokenlist', {'map': T\
rue}),
                         'diff_command': 'unicommand',
                         'nntp_host': ('unicode', {'map': True}),
...                                                                    

_TYPEMAP

The mapping of all available type names to their actual implementation classes. It should be modified by the registerType method only. The classes are expressed by their fully qualified names in string form (like 'svnmailer.settings._accessors.UnicodeMember'). The dict is initially filled with builtin descriptor classes.
Type:
dict
Value:
{'bool': 'svnmailer.settings._accessors.BooleanMember',
 'filename': 'svnmailer.settings._accessors.FilenameMember',
 'humanbool': 'svnmailer.settings._accessors.HumanBooleanMember',
 'int': 'svnmailer.settings._accessors.IntegerMember',
 'mailaction': 'svnmailer.settings._accessors.MailactionMember',
 'quotedstr': 'svnmailer.settings._accessors.QuotedstringMember',
 'regex': 'svnmailer.settings._accessors.RegexMember',
 'stdin': 'svnmailer.settings._accessors.StdinMember',
...                                                                    

_util

The util module
Type:
module

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