Package svnmailer :: Package settings :: Module _typedstruct :: Class StructCreator
[show private | hide private]
[frames | no frames]

Class StructCreator

object --+
         |
        StructCreator


Struct creator class
Method Summary
  __init__(self, members, cls, aliases, typemap, eqignore)
Initialization
Descriptor _createDescriptor(self, name, private, member)
Returns a new Descriptor instance
MetaClass _createMetaClass(self, name, bases, cdict)
Returns a new MetaClass instance
Private _createPrivate(self)
Returns a new Private instance
callable _generateCall(self, private)
Returns the __call__ method
callable _generateEq(self, private, iseq)
Returns __eq__/__ne__ descriptor
callable _generateGetItem(self, private)
Returns the __getitem__ method
dict _generateMembers(self, private, maps, arg)
Generates the members descriptors
callable _generateRepr(self, private)
Returns the __repr__ method
callable _generateSetItem(self, private)
Returns the __setitem__ method
dict _generateSpecials(self, private)
Generates the special methods
tuple _prepareMembers(self, members, typemap)
Prepares the member specs for later processing
Struct create(self, maps, arg, initkw)
Creates a new struct with extended properties
    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
dict _aliases: The member aliases.
MetaClass _cls: The struct class to use
dict _eqignore: Member names to be ignored in EQ comparisons (dict for faster lookup)
dict _members: The prepared members ({('name', 'alias', 'alias', ...): (spec, param), ...})
tuple _names: The member names as tuple (without aliases)

Class Variable Summary
MetaClass _BASESTRUCT = svnmailer.settings._typedstruct.Struct
Member _DEFAULTMEMBER = svnmailer.settings._typedstruct.Member
Struct _DEFAULTSTRUCT = svnmailer.settings._typedstruct.Struct

Method Details

__init__(self, members, cls=None, aliases=None, typemap=None, eqignore=None)
(Constructor)

Initialization
Parameters:
members - The list of members. This is either a list of strings (representing the name) or a dict, where each key is the member name and the value specifies the type of the member. Actually, a plain list a special case of the latter. It can also be written as a dict with all values set to None. ({'name': any, ...})
           (type=iterable or dict)
cls - The class to create. It should inherit from Struct
           (type=Struct)
aliases - The member aliases. ({'alias': 'real', ...})
           (type=dict)
typemap - The type map ({'type': descriptor class})
           (type=dict)
eqignore - Member names to be ignored in EQ comparisons. If None, different containers are always considered different.
           (type=sequence)
Overrides:
__builtin__.object.__init__

_createDescriptor(self, name, private, member)

Returns a new Descriptor instance
Parameters:
name - The name of the member
           (type=str)
private - The private data container
           (type=Private)
member - The actual member instance
           (type=Member)
Returns:
A new Descriptor instance
           (type=Descriptor)

_createMetaClass(self, name, bases, cdict)

Returns a new MetaClass instance
Parameters:
name - The name of the new class
           (type=str)
bases - The base classes
           (type=tuple)
cdict - The initial dictionary
           (type=dict)
Returns:
A new MetaClass instance
           (type=MetaClass)

_createPrivate(self)

Returns a new Private instance
Returns:
A new Private instance
           (type=Private)

_generateCall(self, private)

Returns the __call__ method
Parameters:
private - The private data container
           (type=Private)
Returns:
The method function
           (type=callable)

_generateEq(self, private, iseq=True)

Returns __eq__/__ne__ descriptor
Parameters:
private - The private data container
           (type=Private)
Returns:
The method function
           (type=callable)

_generateGetItem(self, private)

Returns the __getitem__ method
Parameters:
private - The private data container
           (type=Private)
Returns:
The method function
           (type=callable)

_generateMembers(self, private, maps, arg)

Generates the members descriptors
Parameters:
private - The private data container
           (type=Private)
maps - The mappers to use ({'membername': mapper, ...})
           (type=dict)
arg - Initializer argument for the descriptors
           (type=any)
Returns:
The member descriptors ({'name': descriptor, ...})
           (type=dict)
Raises:
AssertionError - Something was inconsistent or wrong

_generateRepr(self, private)

Returns the __repr__ method
Parameters:
private - The private data container
           (type=Private)
Returns:
The method function
           (type=callable)

_generateSetItem(self, private)

Returns the __setitem__ method
Parameters:
private - The private data container
           (type=Private)
Returns:
The method function
           (type=callable)

_generateSpecials(self, private)

Generates the special methods
Parameters:
private - The private data container
           (type=Private)
Returns:
The special methods ({'name': method, ...})
           (type=dict)

_prepareMembers(self, members, typemap)

Prepares the member specs for later processing
Parameters:
members - The list of members. This is either a list of strings (representing the name) or a dict, where each key is the member name and the value specifies the type of the member. Actually, a plain list a special case of the latter. It can also be written as a dict with all values set to None. ({'name': any, ...})
           (type=sequence or mapping)
typemap - The type map ({'type': descriptor class})
           (type=dict)
Returns:
The prepared members ({('name', 'alias', 'alias', ...): (spec, param), ...}) and the member names as sequence (('name', ...))
           (type=tuple)
Raises:
AssertionError - Something in the member or typemap spec is bogus

create(self, maps=None, arg=None, initkw=None)

Creates a new struct with extended properties
Parameters:
maps - The mappers to use ({'membername': mapper, ...})
           (type=dict)
arg - Initializer argument for the descriptors
           (type=any)
initkw - Initial values of members ({'name', 'value', ...})
           (type=dict)
Returns:
A new instance of the class
           (type=Struct)
Raises:
AssertionError - The parameter set was inconsistent

Instance Variable Details

_aliases

The member aliases. ({'alias': 'real', ...})
Type:
dict

_cls

The struct class to use
Type:
MetaClass

_eqignore

Member names to be ignored in EQ comparisons (dict for faster lookup)
Type:
dict

_members

The prepared members ({('name', 'alias', 'alias', ...): (spec, param), ...})
Type:
dict

_names

The member names as tuple (without aliases)
Type:
tuple

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