##// END OF EJS Templates
Don't register the same callabck multiple times...
Quentin Peter -
Show More
@@ -60,7 +60,8 b' class EventManager(object):'
60 60 if not callable(function):
61 61 raise TypeError('Need a callable, got %r' % function)
62 62 callback_proto = available_events.get(event)
63 self.callbacks[event].append(callback_proto.adapt(function))
63 if function not in self.callbacks[event]:
64 self.callbacks[event].append(callback_proto.adapt(function))
64 65
65 66 def unregister(self, event, function):
66 67 """Remove a callback from the given event."""
General Comments 0
You need to be logged in to leave comments. Login now