delegate module#
- class delegate.Delegate#
Bases:
object
Handles the delegation of events to listeners
- Parameters:
listeners (list) – The listeners to add
- add_listener(listener)#
Add a listener to the delegate
- Parameters:
listener (function) – The listener to add
- notify_all(*args, **kwargs)#
Notify all listeners of the delegate
- Parameters:
args (list) – The arguments to pass to the listeners
kwargs (dict) – The keyword arguments to pass to the listeners
- remove_listener(listener)#
Remove a listener from the delegate
- Parameters:
listener (function) – The listener to remove