Eidolon
|
Inherits object.
Public Member Functions | |
def | __init__ (self) |
def | addEventHandler (self, name, cb, isPriority=False, isPostEvent=False) |
def | removeEventHandler (self, cb) |
Public Attributes | |
eventHandlers | |
eventPostHandlers | |
handleLock | |
suppressedEvents | |
Private Member Functions | |
def | _triggerEvent (self, name, args) |
Event broadcast class which invokes callable objects when an EventType event occurs. For every named event, this maintains a list of callback callable objects which accept a set of parameters specific for each event type. When _triggerEvent() is called, each callback associated with the given event name is called with the given arguments passed in. If the callback returns True then subsequent callbacks for that type are ignored. A second list of post event handlers is also maintained which is processed after regular events with the return value ignored. This can be used to register events which must occur last and which must not be skipped.
def __init__ | ( | self | ) |
|
private |
Broadcast event to handler callback functions, stopping for any regular callback that returns True. For every callback associated with event `name', call it expanding `args' as the arguments. This must be called in the main thread. Callbacks stored as post event handlers are called after regular ones with the stop feature ignored.
def addEventHandler | ( | self, | |
name, | |||
cb, | |||
isPriority = False , |
|||
isPostEvent = False |
|||
) |
Add the callback callable `cb' for event named `name'. If `isPriority', `cb' is placed at the start of the event list, and the end otherwise. If `isPostEvent' is True then `cb' is added as a post event callback which is then called after regular callbacks with the return value ignored, ie. always gets called.
def removeEventHandler | ( | self, | |
cb | |||
) |
Remove the callback `cb' from wherever it occurs.
eventHandlers |
eventPostHandlers |
handleLock |
suppressedEvents |