You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/libs/signalr/events/_events.py

16 lines
377 B

class EventHook(object):
def __init__(self):
self._handlers = []
def __iadd__(self, handler):
self._handlers.append(handler)
return self
def __isub__(self, handler):
self._handlers.remove(handler)
return self
def fire(self, *args, **kwargs):
for handler in self._handlers:
handler(*args, **kwargs)