Package gavo :: Package base :: Module xmlstruct :: Class EventProcessor
[frames] | no frames]

Class EventProcessor

source code

object --+
         |
        EventProcessor

A dispatcher for parse events to structures.

It is constructed with the root structure of the result tree, either as a type or as an instance.

After that, events can be fed to the feed method that makes sure they are routed to the proper object.

Instance Methods
 
__init__(self, rootStruct, ctx)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
feed(self, type, name, value=None)
feeds an event.
source code
 
feedEvent(self, ctx, evType, name, value)
dispatches an event to the root structure.
source code
 
setRoot(self, root)
artifically inserts an instanciated root element.
source code
 
clone(self) source code

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

Class Variables
  debug = False
Properties

Inherited from object: __class__

Method Details

__init__(self, rootStruct, ctx)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

feed(self, type, name, value=None)

source code 

feeds an event.

This is the main entry point for user calls.

feedEvent(self, ctx, evType, name, value)

source code 

dispatches an event to the root structure.

Do not call this yourself unless you know what you're doing. The method to feed "real" events to is feed.

setRoot(self, root)

source code 

artifically inserts an instanciated root element.

In particular, this bypasses any checks that the event stream coming is is actually destined for root. Use this for replay-type things (feedFrom, active tags) exclusively.