Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Attributes
GenericSetup.registry._ImportStepRegistryParser Class Reference
Inheritance diagram for GenericSetup.registry._ImportStepRegistryParser:
Inheritance graph
[legend]
Collaboration diagram for GenericSetup.registry._ImportStepRegistryParser:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def startElement
def characters
def endElement

Static Public Attributes

tuple security = ClassSecurityInfo()

Private Attributes

 _encoding
 _started
 _pending
 _parsed

Detailed Description

Definition at line 100 of file registry.py.


Constructor & Destructor Documentation

Definition at line 106 of file registry.py.

00106 
00107     def __init__( self, encoding ):
00108 
00109         self._encoding = encoding
00110         self._started = False
00111         self._pending = None
00112         self._parsed = []


Member Function Documentation

Definition at line 143 of file registry.py.

00143 
00144     def characters( self, content ):
00145 
00146         if self._pending is not None:
00147             content = self._encode( content )
00148             self._pending.setdefault( 'description', [] ).append( content )

Here is the call graph for this function:

Definition at line 149 of file registry.py.

00149 
00150     def endElement(self, name):
00151 
00152         if name == 'import-steps':
00153             pass
00154 
00155         elif name == 'import-step':
00156 
00157             if self._pending is None:
00158                 raise ValueError, 'No pending step!'
00159 
00160             deps = tuple( self._pending[ 'dependencies' ] )
00161             self._pending[ 'dependencies' ] = deps
00162 
00163             desc = ''.join( self._pending[ 'description' ] )
00164             self._pending[ 'description' ] = desc
00165 
00166             self._parsed.append( self._pending )
00167             self._pending = None
00168 
00169 InitializeClass( _ImportStepRegistryParser )
00170 

Definition at line 113 of file registry.py.

00113 
00114     def startElement( self, name, attrs ):
00115 
00116         if name == 'import-steps':
00117 
00118             if self._started:
00119                 raise ValueError, 'Duplicated setup-steps element: %s' % name
00120 
00121             self._started = True
00122 
00123         elif name == 'import-step':
00124 
00125             if self._pending is not None:
00126                 raise ValueError, 'Cannot nest setup-step elements'
00127 
00128             self._pending = dict( [ ( k, self._extract( attrs, k ) )
00129                                     for k in attrs.keys() ] )
00130 
00131             self._pending[ 'dependencies' ] = []
00132 
00133         elif name == 'dependency':
00134 
00135             if not self._pending:
00136                 raise ValueError, 'Dependency outside of step'
00137 
00138             depended = self._extract( attrs, 'step' )
00139             self._pending[ 'dependencies' ].append( depended )
00140 
00141         else:
00142             raise ValueError, 'Unknown element %s' % name

Here is the call graph for this function:


Member Data Documentation

Definition at line 108 of file registry.py.

Definition at line 111 of file registry.py.

Definition at line 110 of file registry.py.

Definition at line 109 of file registry.py.

tuple GenericSetup.registry._ImportStepRegistryParser.security = ClassSecurityInfo() [static]

Definition at line 102 of file registry.py.


The documentation for this class was generated from the following file: