Home | Trees | Indices | Help |
|
---|
|
object --+ | Dispatcher
Utility class for dispatching events to handlers.
Events have to be registered before they can be dispatched or have handlers added to them.
Handlers can have an owner associated with them, usually you'll use the reference of the listener. This allows you to remove all the handlers of a specific owner, which should save you some work.
Instance methods:
- add_handler: Add handler for an event
- remove_handlers: Remove all or some handlers
- remove_handler: Remove a handler
- dispatch: Dispatch an event
- register_events: Register events
- has_event: Check whether event is supported
Instance properties:
- events: Read-only, set of all supported events
Instance decorators:
- event: Register decorated as a handler
Class invariants:
- For every (owner, event), there can be only 0 or 1 handlers
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
|
|
|||
_delegator_factory = <pytilities.delegation.delegatorfactory.D
|
|
|||
events Read-only, set of all supported events |
|||
Inherited from |
|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
Add handler for an event, optionally with an owner. Parameters:
Raises:
|
Remove all or some handlers of the dispatcher.
If no handler matched the criterea, the method will return silently. Parameters:
|
Remove a handler from an event. It is an error to try to remove a handler from an event that doesn't have this handler attached to it. Parameters:
|
Dispatch an event to its handlers. The handlers are executed in a random order. Parameters:
|
Register the decorated as a handler of Parameters:
|
Register events. Parameters:
|
Checks if Parameters:
Returns True if the dispatcher has the event
|
Construct a delegator with a stored Profile. Parameters:
Returns newly created delegator :: Delegator Raises:
|
|
_delegator_factory
|
|
eventsRead-only, set of all supported events Returns ::frozenset(string...)
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0 on Thu Jul 22 13:11:42 2010 | http://epydoc.sourceforge.net |