# HG changeset patch # User Sylvain Thénault # Date 1269948721 -7200 # Node ID 2ea98b8512ddbfcf40406ca3ec699f436f71d25f # Parent cfc7c2b24f9ef2d884149be0b047d673beab4317 [events manager] onevent decorator may be given extra arguments to give to em.bind diff -r cfc7c2b24f9e -r 2ea98b8512dd __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