Beispiel #1
0
 def addHandler(self, event, callback, priority=5):
     PriorityEvent = namedtuple("PriorityEvent", "priority callback")
     self.handlers[event].append(PriorityEvent(priority, WeakCallback(callback)))
Beispiel #2
0
 def addHandler(self, event, callback, *args, **kw):
     self.handlers[event].append(WeakCallback(callback))
     return partial(self.handleEvent, event)
Beispiel #3
0
 def addHandler(self, event, callback, *args, **kw):
     self.handlers[event].append(WeakCallback(callback))
Beispiel #4
0
 def addHandler(self, event, callback, *args, **kwargs):
     if not self.isRunning:
         self.isRunning = True
         self.startThread()
     self.handlers[event].add(WeakCallback(callback))