Package wx :: Package lib :: Module pubsub
[frames | no frames]

Module wx.lib.pubsub

This module provides a publish-subscribe component that allows listeners to subcribe to messages of a given topic. Contrary to the original wxPython.lib.pubsub module (which it is based on), it uses weak referencing to the subscribers so the lifetime of subscribers is not affected by Publisher. Also, callable objects can be used in addition to functions and bound methods. See Publisher class docs for more details.

Thanks to Robb Shecter and Robin Dunn for having provided the basis for this module (which now shares most of the concepts but very little design or implementation with the original wxPython.lib.pubsub).

The publisher is a singleton instance of the PublisherClass class. You access the instance via the Publisher object available from the module:

from wx.lib.pubsub import Publisher
Publisher().subscribe(...)
Publisher().sendMessage(...)
...

Version:

$Id: pubsub.py,v 1.8 2006/06/11 00:12:59 RD Exp $

Author:

Oliver Schoenborn

Copyright:

(c) 2004 Oliver Schoenborn

License:

wxWidgets

Since:

Apr 2004

Classes
Message A simple container object for the two components of a message: the topic and the user data.
PublisherClass The publish/subscribe manager.

Function Summary
  getStrAllTopics()
Function to call if, for whatever reason, you need to know explicitely what is the string to use to indicate 'all topics'.
  test()

Variable Summary
str ALL_TOPICS = ''
PublisherClass Publisher = <wx.lib.pubsub.PublisherClass instance at 0x...

Function Details

getStrAllTopics()

Function to call if, for whatever reason, you need to know explicitely what is the string to use to indicate 'all topics'.


Variable Details

ALL_TOPICS

Type:
str
Value:
''                                                                     

Publisher

Type:
PublisherClass
Value:
<wx.lib.pubsub.PublisherClass instance at 0xb58b772c>                  

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:08:09 2007 http://epydoc.sf.net