Package gavo :: Package grammars :: Module common :: Class SourceFieldApp
[frames] | no frames]

Class SourceFieldApp

source code

                   object --+                    
                            |                    
 base.structure.StructureBase --+                
                                |                
                   object --+   |                
                            |   |                
           base.common.Parser --+                
                                |                
base.structure.ParseableStructure --+            
                                    |            
             base.structure.Structure --+        
                                        |        
                           object --+   |        
                                    |   |        
      base.structure.RestrictionMixin --+        
                                        |        
                   rscdef.procdef.ProcDef --+    
                                            |    
                       rscdef.procdef.ProcApp --+
                                                |
                                               SourceFieldApp

A procedure application that returns a dictionary added to all incoming rows.

Use this to programmatically provide information that can be computed once but that is then added to all rows coming from a single source, usually a file. This could be useful to add information on the source of a record or the like.

The code must return a dictionary. The source that is about to be parsed is passed in as sourceToken. When parsing from files, this simply is the file name. The data the rows will be delivered to is available as "data", which is useful for adding or retrieving meta information.

Nested Classes

Inherited from base.structure.StructureBase: __metaclass__

Instance Methods

Inherited from rscdef.procdef.ProcApp: breakCircles, compile, completeElement, getBodySetupCode, getFuncCode, getLateSetupCode, getParSetupCode, getSetupCode, getSetupPars, onElementComplete, validate

Inherited from rscdef.procdef.ProcDef: getCode

Inherited from base.structure.Structure: __provides__, callCompletedCallbacks, finishElement

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

Inherited from base.structure.StructureBase: __providedBy__, adopt, 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_ = 'sourceFields'
a sentinel for all kinds of undefined values.
  requriedType = 'sourceFields'
a sentinel for all kinds of undefined values.
  formalArgs = 'sourceToken, data'

Inherited from rscdef.procdef.ProcApp: additionalNamesForProcs, attrSeq, managedAttrs, requiredType

Inherited from base.structure.Structure: __implemented__

Inherited from base.structure.StructureBase: completedCallbacks

Properties

Inherited from object: __class__