Example #1
0
 def post_event(self, func, *args, **kwargs):
     """Add an event to be called asynchronously."""
     if not callable(func):
         assert(len(func) == 5)
         self._events.append(func + (log.get_tb(1), time.time()))
     else:
         self._events.append((func, args, kwargs, None, 0, log.get_tb(), time.time()))
Example #2
0
 def post_event(self, func, *args, **kwargs):
     """Add an event to be called asynchronously."""
     if not callable(func):
         assert (len(func) == 5)
         self._events.append(func + (log.get_tb(1), time.time()))
     else:
         self._events.append(
             (func, args, kwargs, None, 0, log.get_tb(), time.time()))
Example #3
0
 def replace(self, oldslot, newslot):
     """Replace a slot with a different one (to maintain calling order)."""
     if oldslot not in self._slots:
         raise RuntimeError("%s: Slot not connected to this signal, cannot "
                            "be replaced: %s" % (repr(self), str(oldslot)))
     self._slots[self._slots.index(oldslot)] = newslot
     self._tb.pop(oldslot)
     self._tb[newslot] = log.get_tb()
     return self
Example #4
0
 def replace(self, oldslot, newslot):
     """Replace a slot with a different one (to maintain calling order)."""
     if oldslot not in self._slots:
         raise RuntimeError("%s: Slot not connected to this signal, cannot "
                            "be replaced: %s" % (repr(self), str(oldslot)))
     self._slots[self._slots.index(oldslot)] = newslot
     self._tb.pop(oldslot)
     self._tb[newslot] = log.get_tb()
     return self
Example #5
0
 def connect(self, slot):
     """Connect a callback function to the signal."""
     if slot is not None:
         self._slots.append(slot)
         self._tb[slot] = (log.get_tb(), time.time())
     return self
Example #6
0
 def connect(self, slot):
     """Connect a callback function to the signal."""
     if slot is not None:
         self._slots.append(slot)
         self._tb[slot] =  (log.get_tb(), time.time())
     return self