We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 564d10e commit 72a14dcCopy full SHA for 72a14dc
thingsdb/room/roombase.py
@@ -18,8 +18,8 @@ def __init_subclass__(cls):
18
19
for key, val in cls.__dict__.items():
20
if not key.startswith('__') and \
21
- callable(val) and hasattr(val, '_event'):
22
- cls._event_handlers[val._event] = val # type: ignore
+ callable(val) and hasattr(val, '_ti_event_'):
+ cls._event_handlers[getattr(val, '_ti_event_')] = val
23
24
def __init__(
25
self,
@@ -268,7 +268,7 @@ def _emit_handler(self, data):
268
@staticmethod
269
def event(event: str) -> Callable[[Callable[P, R]], Callable[P, R]]:
270
def wrapped(fun: Callable[P, R]) -> Callable[P, R]:
271
- setattr(fun, '_event', event)
+ setattr(fun, '_ti_event_', event)
272
return fun
273
274
return wrapped
0 commit comments