Package gavo :: Package rscdef :: Module procdef :: Class ProcSetup
[frames] | no frames]

Class ProcSetup

source code

                   object --+            
                            |            
 base.structure.StructureBase --+        
                                |        
                   object --+   |        
                            |   |        
           base.common.Parser --+        
                                |        
base.structure.ParseableStructure --+    
                                    |    
             base.structure.Structure --+
                                        |
                                       ProcSetup

Prescriptions for setting up a namespace for a procedure application.

You can add names to this namespace you using par(ameter)s. If a parameter has no default and an procedure application does not provide them, an error is raised.

You can also add names by providing a code attribute containing a python function body in code. Within, the parameters are available. The procedure application's parent can be accessed as parent. All names you define in the code are available as globals to the procedure body.

Caution: Macros are expanded within the code; this means you need double backslashes if you want a single backslash in python code.

Nested Classes

Inherited from base.structure.StructureBase: __metaclass__

Instance Methods
 
getParCode(self, bindings)
returns code doing setup bindings un-indented.
source code
 
getLateCode(self, bindings)
returns code doing late (in-function) bindings indented with two spaces.
source code
 
getBodyCode(self)
returns the body code un-indented.
source code

Inherited from base.structure.Structure: __provides__, callCompletedCallbacks, completeElement, finishElement, onElementComplete, validate

Inherited from base.structure.ParseableStructure: __init__, end_, feed, feedFrom, feedObject, getAttribute, iterEvents, start_, value_

Inherited from base.structure.StructureBase: __providedBy__, adopt, breakCircles, change, copy, getAttributes, getCopyableAttributes, getSourcePosition, iterChildren, setPosition

Inherited from base.common.Parser: feedEvent

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods

Inherited from base.structure.StructureBase: fromStructure

Class Variables
  name_ = 'setup'
a sentinel for all kinds of undefined values.
  attrSeq = [<gavo.base.complexattrs.ListOfAtomsAttribute object...
  managedAttrs = {'code': <gavo.base.complexattrs.ListOfAtomsAtt...

Inherited from base.structure.Structure: __implemented__

Inherited from base.structure.StructureBase: completedCallbacks

Properties

Inherited from object: __class__

Class Variable Details

attrSeq

Value:
[<gavo.base.complexattrs.ListOfAtomsAttribute object>,
 <gavo.base.parsecontext.IdAttribute object>,
 <gavo.base.parsecontext.OriginalAttribute object>,
 <gavo.base.complexattrs.StructListAttribute object>]

managedAttrs

Value:
{'code': <gavo.base.complexattrs.ListOfAtomsAttribute object>,
 'codeFrags': <gavo.base.complexattrs.ListOfAtomsAttribute object>,
 'id': <gavo.base.parsecontext.IdAttribute object>,
 'original': <gavo.base.parsecontext.OriginalAttribute object>,
 'par': <gavo.base.complexattrs.StructListAttribute object>,
 'pars': <gavo.base.complexattrs.StructListAttribute object>}