1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. module:: wx.lib.pubsub.utils.notification
.. currentmodule:: wx.lib.pubsub.utils.notification
.. highlight:: python
.. _wx.lib.pubsub.utils.notification:
==========================================================================================================================================
|phoenix_title| **wx.lib.pubsub.utils.notification**
==========================================================================================================================================
Provide an interface class for handling pubsub notification messages,
and an example class (though very useful in practice) showing how to
use it.
Notification messages are generated by pubsub
- if a handler has been configured via pub.addNotificationHandler()
- when pubsub does certain tasks, such as when a listener subscribes to
or unsubscribes from a topic
Derive from this class to handle notification events from
various parts of pubsub. E.g. when a listener subscribes,
unsubscribes, or dies, a notification handler, if you
specified one via pub.addNotificationHandler(), is given the
relevant information.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
|function_summary| Functions Summary
====================================
================================================================================ ================================================================================
:func:`~wx.lib.pubsub.utils.notification.useNotifyByPubsubMessage` Will cause all of pubsub's notifications of pubsub "actions" (such as
:func:`~wx.lib.pubsub.utils.notification.useNotifyByWriteFile` Will cause all pubsub notifications of pubsub "actions" (such as
================================================================================ ================================================================================
|
|class_summary| Classes Summary
===============================
================================================================================ ================================================================================
:ref:`~wx.lib.pubsub.utils.notification.IgnoreNotificationsMixin` Derive your Notifications handler from this class if your handler
:ref:`~wx.lib.pubsub.utils.notification.NotifyByPubsubMessage` Handle pubsub notification messages by generating
:ref:`~wx.lib.pubsub.utils.notification.NotifyByWriteFile` Print a message to stdout when a notification is received.
================================================================================ ================================================================================
|
.. toctree::
:maxdepth: 1
:hidden:
wx.lib.pubsub.utils.notification.IgnoreNotificationsMixin
wx.lib.pubsub.utils.notification.NotifyByPubsubMessage
wx.lib.pubsub.utils.notification.NotifyByWriteFile
Functions
------------
.. function:: useNotifyByPubsubMessage(publisher=None, all=True, \*\*kwargs)
Will cause all of pubsub's notifications of pubsub "actions" (such as
new topic created, message sent, listener subscribed, etc) to be sent
out as messages. Topic will be 'pubsub' subtopics, such as
'pubsub.newTopic', 'pubsub.delTopic', 'pubsub.sendMessage', etc.
The 'all' and kwargs args are the same as pubsub's setNotificationFlags(),
except that 'all' defaults to True.
The publisher is rarely needed:
* The publisher must be specfied if pubsub is not installed
on the system search path (ie from pubsub import ... would fail or
import wrong pubsub -- such as if pubsub is within wxPython's
wx.lib package). Then pbuModule is the pub module to use::
from wx.lib.pubsub import pub
from wx.lib.pubsub.utils import notification
notification.useNotifyByPubsubMessage()
.. function:: useNotifyByWriteFile(fileObj=None, prefix=None, publisher=None, all=True, \*\*kwargs)
Will cause all pubsub notifications of pubsub "actions" (such as
new topic created, message sent, listener died etc) to be written to
specified file (or stdout if none given). The fileObj need only
provide a 'write(string)' method.
The first two arguments are the same as those of NotifyByWriteFile
constructor. The 'all' and kwargs arguments are those of pubsub's
setNotificationFlags(), except that 'all' defaults to True. See
useNotifyByPubsubMessage() for an explanation of pubModule (typically
only if pubsub inside wxPython's wx.lib)
|