Beispiel #1
0
 def unregister_event_callback(self, callback):
     with self.__event_handlers_lock:
         if callback in self.__event_handlers:
             self.__event_handlers.remove(callback)
         else:
             l.debug("The callback you tried to unregister is not present.")
             pass
Beispiel #2
0
 def register_event_callback(self, callback):
     with self.__event_handlers_lock:
         if callback not in self.__event_handlers:
             self.__event_handlers.append(callback)
         else:
             l.debug("The callback you tried to register is already present.")
             pass