Table Of Contents

Previous topic

About

Next topic

Use

This Page

Install

System Requirements

Requires any Python 2.6 to 3.4. PyPubSub will also work in Python 2.5 if the patch, available in the tests folder, is applied, and most likely with Pypy 2.1.

The following table identifies on which combination of Python and Platform the unit tests have been run. The result for each combination is number of tests passed out of total number of tests, or “n/t” for “not tested”:

Windows 7 Linux(++) OSX
Python 2.4.4 0/64(*) n/t n/t
Python 2.5 63/64(**) n/t n/t
Python 2.6 64/64 n/t 64/64
Python 2.7 64/64 64/64 64/64
PyPy 2.1 63/64(+) n/t n/t
Python 3.2 64/64 64/64 n/t
Python 3.3 64/64 n/t n/t
Python 3.4a4 64/64 n/t n/t

Notes: (*) Due to relative imports; also, required two test harness files (nose/failure.py and nose/capture.py) to be patched (one line each): change BaseException (introduced in Python 2.5) to Exception. (**) A dozen failures could be easily corrected by replacing use of __self__, not available in py25, by im_self. Once the patch saved in tests folder is applied to root of working copy, only one failure remains, related to listener naming, not something that would affect use of pypubsub in an application. (+) All failures appear related to lifetime of weak references being longer than cpython’s, need gc.collect() in tests so in practice likely ok. (++) Tested on Fedora, OpenSuse, and Ubuntu.

Please post on pypubsub forum (see Support section) if you have successfully used pubsub with other combinations of Python and Platform.

Many thanks to Jerome Laheurte for providing a buildbot with Linux and OSX VM’s for continuous testing.

How-to

Several methods are available: egg distribution, Windows installer, zip file with source, or directly from source code repository.

Method 1. Using pip

With pip installed on your system, do pip install pypubsub.

If you want the developer version, you can try pip install –pre pypubsub.

Method 2. Using setuptools (easy_install)

With setuptools installed on your machine, do easy_install -Z pypubsub in a console/shell window.

If for whatever reason easy_install can’t find the pypubsub download, you could try manually downloading the egg distribution from SourceForge.net. Then do easy_install -Z <downloaded_egg>

Method 3. Using Installer (Windows only)

Download the Installer (PyPubSub-xxx.win32.exe) from SourceForge.net and run it.

Method 4. From source distribution

  1. Download the appropriate ZIP file from SourceForge.net.
  2. Extract the contents
  3. From a console window, cd’d to extracted folder, do python setup.py install

Method 5. From source code repository

  1. Using a subversion client, do an SVN checkout of svn://svn.code.sf.net/p/pubsub/code/trunk or http://svn.code.sf.net/p/pubsub/code/trunk
  2. From a console window, cd to working copy
  3. In console, do python setup.py install
SourceForge.net Logo

Support

The forums are currently hosted on google groups:

Also, many pypubsub users are on the wxPython-users mailing list.

Release Notes

For PyPubSub v3.3.0

  • cleanup low-level API: exception classes, moved some out of pub module that did not belong there (clutter), move couple modules,
  • completed the reference documentation
  • support installation via pip
  • follow some guidelines in some PEPs such as PEP 396 and PEP 8
  • support Python 2.6, 2.7, and 3.2 to 3.4a4 but drop support for Python <= 2.5

For PyPubSub v3.2.0

This is a minor release for small improvements made (see docs/CHANGELOG.txt) based on feedback from user community. In particular an XML reader for topic specification contributed by Josh English. Also cleaned up the documentation, updated the examples folder (available in source distribution as well as online).

Only 3 changes to API (function names):

  • renamed pub.getDefaultRootAllTopics to pub.getDefaultTopicTreeRoot
  • removed pub.importTopicTree: use pub.addTopicDefnProvider(source, format)
  • renamed pub.exportTopicTree to pub.exportTopicTreeSpec

Oliver Schoenborn September 2013

PyPubSub 3.1.2

This is a minor release for small improvements made (see docs/CHANGELOG.txt) based on feedback from user community. Also extended the documentation. See pubsub.sourceforge.net for installation and usage. See the examples folder for some useful examples.

Oliver Schoenborn Nov 2011

PyPubSub 3.1.1b1

Docs updated.

Oliver Schoenborn May 2010

For PyPubSub v3.1.0b1

Major cleanup of the API since 3.0 and better support for the legacy wxPython code. Defining a topic tree via a text file has been improved drastically, making it simpler to document topic messages and payload data required or optional. More examples have been added, and the messaging protocols clarified.

The included docs are not yet updated, that’s what I’m working on now and will lead to the 3.1.1b1 release. I’m also working on an add-on module that would allow two applications to communicate over the network using pubsub-type messaging (with topics, etc). The design is almost complete.

Oliver Schoenborn Jan 2010

Changelog

High-level changelog. For details, consult the SVN logs.

3.3.0 (Nov 2013):
 
  • cleanup low-level API: exception classes, moved some out of pub module that did not belong there (clutter), move couple modules; specifically:
    • Removed from pub (available on object returned from pub.getDefaultTopicMgr()) * getOrCreateTopic -> pub.getDefaultTopicMgr().getOrCreateTopic * getTopic -> pub.getDefaultTopicMgr().getTopic * newTopic -> pub.getDefaultTopicMgr().newTopic * delTopic -> pub.getDefaultTopicMgr().delTopic * getAssociatedTopics -> pub.getDefaultTopicMgr().getTopics * getDefaultTopicTreeRoot -> pub.getDefaultTopicMgr().getRootAllTopics
    • Removed from pub (available from pubsub.core): * ITopicDefnProvider
    • Moved from pub into to pubsub.core.TopicDefnProvider class as classmethod: * registerTopicDefnProviderType
    • Renamed: * TopicNameInvalid -> TopicNameError * UndefinedTopic(RuntimeError) -> TopicNameError(ValueError) * UndefinedSubtopic(RuntimeError) -> TopicNameError(ValueError) * ListenerInadequate(TypeError) -> ListenerMismatchError(ValueError) * UnrecognizedImportFormat -> UnrecognizedSourceFormatError * ListenerSpecInvalid -> MessageDataSpecError * SenderMissingReqdArgs -> SenderMissingReqdMsgDataError * SenderUnknownOptArgs -> SenderUnknownMsgDataError * ListenerNotValidatable -> TopicDefnErrorcd
    • Changed; * Topic.isSendable -> hasMDS * TopicManager.??? -> isTopicInUse + hasTopicDefinition
  • completed the ref docs
  • support installation via pip
  • cleanup versioning metadata: use pubsub.__version__ instead of pub.PUBSUB_VERSION
  • support Python 3
  • add getListenersIter() to iterate over listeners without temp copy of listener list
  • add deprecation message when import setuparg1
  • new wxPubsubMonitor utility class
3.2.0 (sep 2013):
 
  • cleanup of docs
  • merged importTopicTree to addTopicDefnProvider
  • renamed pub.getDefaultRootAllTopics to pub.getDefaultTopicTreeRoot
  • removed pub.importTopicTree, use pub.addTopicDefnProvider(source, format)
  • renamed pub.exportTopicTree to pub.exportTopicTreeSpec
  • several minor bug fixes
  • incorporated some patches contributed by users: one for performance improvement when high-frequency of subscribers/messages; one for reading topic tree specification from XML rather than .py module
  • v1 and v2 APIs no longer supported
3.1.2 (2011):
  • added some docs
  • more configurable importTopicTree
  • using importTopicTree now allows to use the topic hierarchy as topic names instead of string, thereby enabling python editors to support pubsub-based development via code completion and sendMessage keyword arguments.
3.1.1b (2010):
  • cleanup docs
  • couple minor tweaks (for instance added pub.getMsgProtocol())
3.1.0b (2009):
  • Import/export of topic tree and its documentation using Python interpreter
  • Better support for evolving topic tree during application development, with “freezing” certain parts of tree
  • Helper functions to transition from arg1 to kwargs messaging protocol
  • Improved error messages (in exceptions raised)
  • pubsub can be installed inside other packages and will not interfere with system-wide pubsub
  • pubsubconf module moved inside pubsub package so manual install easier
  • Support !**kwargs in listeners
  • Support for more than one pubusb notification handler
  • Multiple publisher engines in one application (for instance, in separate threads, or for different “domains” in a large application)
  • Upgraded docs
  • Bug fixes, cleanup
3.0 (2008):
  • Use keyword arguments in sendMessage
  • Support any kind of listener, not just those with one unnamed argument
  • Validate listeners at subscription time
  • Support “inheritance” of keyword arguments by subtopics during message sending (prevents a common bug which was to send data using wrong argument names).
  • Topic tree can be documented (including topic message arguments)
  • Support user-defined notification handling of certain events occuring in pubsub such as “subscribe”, “sendMessage”.
  • Support user-defined exception handling of exceptions raised by listeners
  • Proto-Documentation on own website using Sphinx
  • Separate regression testing folder for nose-based automated testing
  • Configuration module for choosing which pubsub API to use in application, useful for backwards compatibility
2.0 (2007):
  • more Pythonic API (new PublisherClass API, at module level so easier to call – no need to know about singleton)
  • Support definition of topic tree via a python class, for increased rigor and documentability of topics
  • Topics are objects
1.0 (2005):
  • Given its own “home” as separate package from wxPython’s wx.lib.pubsub
  • Factored out weakmethod
  • Put on Cheese Shop
Pre 1.0:
  • Created by Rob Shecter in wxPython’s wx.lib (early 2000?)
  • Weakmethod added by Oliver Schoenborn (2004)
  • Further development transfered to Schoenborn (2004)