[events manager] onevent decorator may be given extra arguments to give to em.bind stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 30 Mar 2010 13:32:01 +0200
branchstable
changeset 5081 2ea98b8512dd
parent 5080 cfc7c2b24f9e
child 5082 d6fd82a5a4e8
child 5083 82bbf2e1a04b
child 5088 891cdb7d8cbb
[events manager] onevent decorator may be given extra arguments to give to em.bind
__init__.py
--- a/__init__.py	Tue Mar 30 13:31:21 2010 +0200
+++ b/__init__.py	Tue Mar 30 13:32:01 2010 +0200
@@ -112,7 +112,7 @@
 
 CW_EVENT_MANAGER = CubicWebEventManager()
 
-def onevent(event):
+def onevent(event, *args, **kwargs):
     """decorator to ease event / callback binding
 
     >>> from cubicweb import onevent
@@ -123,6 +123,6 @@
     >>>
     """
     def _decorator(func):
-        CW_EVENT_MANAGER.bind(event, func)
+        CW_EVENT_MANAGER.bind(event, func, *args, **kwargs)
         return func
     return _decorator