From f91a644866fa1190683137e214fa73846cae58d0 Mon Sep 17 00:00:00 2001 From: David Hughes Date: Tue, 13 Mar 2018 11:47:06 +0000 Subject: [PATCH] Added a ReST formatted docstring in __init__.py --- wx/lib/pubsub/__init__.py | 43 +++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/wx/lib/pubsub/__init__.py b/wx/lib/pubsub/__init__.py index 49d8524b..c0bceac0 100644 --- a/wx/lib/pubsub/__init__.py +++ b/wx/lib/pubsub/__init__.py @@ -1,18 +1,39 @@ +# Name: __init__.py +# Package: wx.lib.pubsub +# +# Purpose: Pubsub package initialization +# +# Author: Oliver Schoenborn +# Copyright: Oliver Schoenborn +# Licence: BSD, see LICENSE_BSD_Simple.txt for details + +# History: Created 2000/2006 +# +# Tags: phoenix-port, documented +# +#---------------------------------------------------------------------------- + """ -Pubsub package initialization. +**pubsub** is a Python package which provides a publish - subscribe API to facilitate event-based +programming and decoupling of components of an application via the Observer pattern. -:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved. -:license: BSD, see LICENSE_BSD_Simple.txt for details. +Using the Observer pattern in your application can dramatically simplify its design and improve +testability. Basically you just have some part(s) of your program subscribe to a particular topic +and have some other part(s) of your program publish messages with that topic. All the plumbing +is taken care of by pubsub. + +It originated in wxPython around the year 2000 but has been standalone, available on PyPI, since +2006 under the name **Pypubsub** although the code has also been kept in wxPython as wx.lib.pubsub. + +To remove the duplication of the pubsub code in both Pypubsub and wx.lib but to maintain backward +compatibility, wxPython 4 simply imports the standalone package into wx.lib.pubsub. Installing +or updating wxPython should now also install Pypubsub but it can be explicitly installed using +``pip install Pypubsub`` + +The documentation for pubsub is available at https://pypubsub.readthedocs.io/en/v4.0.0/ and the +source code is hosted at https://github.com/schollii/pypubsub """ -# Import pubsub (Version 4.0.0) from site-packages/pubsub - -# Import all items from the pubsub package so they appear -# in the wx.lib.pubsub package namespace. This to maintain -# its appearance as wx.lib.pubsub where it was originally -# created but subsequently published as a stand-alone package -# that is currently sourced from https://github.com/schollii/pypubsub - try: from pubsub import * except ImportError: