Inheritance diagram for IPython.utils.notification:
The IPython Core Notification Center.
See docs/source/development/notification_blueprint.txt for an overview of the notification module.
Authors:
Bases: object
Synchronous notification center.
Examples
Here is a simple example of how to use this:
import IPython.util.notification as notification
def callback(ntype, theSender, args={}):
print ntype,theSender,args
notification.sharedCenter.add_observer(callback, 'NOTIFICATION_TYPE', None)
notification.sharedCenter.post_notification('NOTIFICATION_TYPE', object()) # doctest:+ELLIPSIS
NOTIFICATION_TYPE ...
Add an observer callback to this notification center.
The given callback will be called upon posting of notifications of the given type/sender and will receive any additional arguments passed to post_notification.
Parameters : | callback : callable
ntype : hashable
sender : hashable
|
---|
Post notification to all registered observers.
The registered callback will be called as:
callback(ntype, sender, *args, **kwargs)
Parameters : | ntype : hashable
sender : hashable
*args : tuple
**kwargs : dict
|
---|
Notes
Removes all observers from this notification center