Handlers
This module define the @handler decorator/function and the HandlesType type.
none
Handler Meta Class
metaclass used by the Component to pick up any methods defined in the new Component and turn them into Event Handlers by applying the @handlers decorator on them. This is done for all methods defined in the Component that: - Do not start with a single ‘_’. or - Have previously been decorated with the @handlers decorator
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
none
Creates an Event Handler
Decorator to wrap a callable into an Event Handler that listens on a set of channels defined by channels. The type of the Event Handler defaults to “listener”. If kwargs[“filter”] is defined and is True, the Event Handler is defined as a Filter and has priority over Listener Event Handlers. If kwargs[“target”] is defined and is not None, the Event Handler will listen for the spcified channels on the spcified Target Component’s Channel.
>>> @handler("foo")
... def foo():
... pass
>>> @handler("bar", filter=True)
... def bar():
... pass
>>> @handler("foo", "bar")
... def foobar():
... pass
>>> @handler("x", target="other")
... def x():
... pass