.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.pubsub.core.notificationmgr

.. highlight:: python



.. _wx.lib.pubsub.core.notificationmgr.NotificationMgr:

==========================================================================================================================================
|phoenix_title|  **wx.lib.pubsub.core.notificationmgr.NotificationMgr**
==========================================================================================================================================

Manages notifications for tracing pubsub activity. When pubsub takes a
certain action such as sending a message or creating a topic, and
the notification flag for that activity is True, all registered
notification handlers get corresponding method called with information
about the activity, such as which listener subscribed to which topic.
See INotificationHandler for which method gets called for each activity.

If more than one notification handler has been registered, the order in
which they are notified is unspecified (do not rely on it).

Note that this manager automatically unregisters all handlers when
the Python interpreter exits, to help avoid NoneType exceptions during
shutdown. This "shutdown" starts when the last line of app "main" has
executed; the Python interpreter then starts cleaning up, garbage
collecting everything, which could lead to various pubsub notifications
-- by then they should be of no interest -- such as dead
listeners, etc.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>NotificationMgr</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.pubsub.core.notificationmgr.NotificationMgr_inheritance.png" alt="Inheritance diagram of NotificationMgr" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.pubsub.core.notificationmgr.NotificationMgr.html" title="wx.lib.pubsub.core.notificationmgr.NotificationMgr" alt="" coords="5,5,344,35"/> </map> 
   </p>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.__init__`             
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.addHandler`           
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.clearHandlers`        
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.getFlagStates`        Return state of each notification flag, as a dict.
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.getHandlers`          
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.notifyDeadListener`   
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.notifyDelTopic`       
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.notifyNewTopic`       
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.notifySend`           
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.notifySubscribe`      
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.notifyUnsubscribe`    
:meth:`~wx.lib.pubsub.core.notificationmgr.NotificationMgr.setFlagStates`        Set the notification flag on/off for various aspects of pubsub.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: NotificationMgr

   Manages notifications for tracing pubsub activity. When pubsub takes a
   certain action such as sending a message or creating a topic, and
   the notification flag for that activity is True, all registered
   notification handlers get corresponding method called with information
   about the activity, such as which listener subscribed to which topic.
   See INotificationHandler for which method gets called for each activity.
   
   If more than one notification handler has been registered, the order in
   which they are notified is unspecified (do not rely on it).
   
   Note that this manager automatically unregisters all handlers when
   the Python interpreter exits, to help avoid NoneType exceptions during
   shutdown. This "shutdown" starts when the last line of app "main" has
   executed; the Python interpreter then starts cleaning up, garbage
   collecting everything, which could lead to various pubsub notifications
   -- by then they should be of no interest -- such as dead
   listeners, etc.

   .. method:: __init__(self, notificationHandler = None)


   .. method:: addHandler(self, handler)


   .. method:: clearHandlers(self)


   .. method:: getFlagStates(self)

      Return state of each notification flag, as a dict.


   .. method:: getHandlers(self)


   .. method:: notifyDeadListener(self, \*args, \*\*kwargs)


   .. method:: notifyDelTopic(self, \*args, \*\*kwargs)


   .. method:: notifyNewTopic(self, \*args, \*\*kwargs)


   .. method:: notifySend(self, \*args, \*\*kwargs)


   .. method:: notifySubscribe(self, \*args, \*\*kwargs)


   .. method:: notifyUnsubscribe(self, \*args, \*\*kwargs)


   .. method:: setFlagStates(self, subscribe=None, unsubscribe=None, deadListener=None, sendMessage=None, newTopic=None, delTopic=None, all=None)

      Set the notification flag on/off for various aspects of pubsub.
      The kwargs that are None are left at their current value. The 'all',
      if not None, is set first. E.g.
      
          mgr.setFlagStates(all=True, delTopic=False)
      
      will toggle all notifications on, but will turn off the 'delTopic'
      notification.


