diff options
Diffstat (limited to 'src/zope/event/classhandler.py')
-rw-r--r-- | src/zope/event/classhandler.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/zope/event/classhandler.py b/src/zope/event/classhandler.py index c839901..3c80944 100644 --- a/src/zope/event/classhandler.py +++ b/src/zope/event/classhandler.py @@ -42,13 +42,14 @@ new-style event classes are supported, and then by order of registry. """ import zope.event -registry = {} +__all__ = [ + 'handler', +] -def handler(event_class, handler_=None, decorator=False): - """ - handler(event_class, [handler]) -> None +registry = {} - Define an event handler for a (new-style) class. +def handler(event_class, handler_=None, _decorator=False): + """ Define an event handler for a (new-style) class. This can be called with a class and a handler, or with just a class and the result used as a handler decorator. @@ -64,7 +65,7 @@ def handler(event_class, handler_=None, decorator=False): else: registry[event_class].append(handler_) - if decorator: + if _decorator: return handler def dispatch(event): |