mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 20:10:08 +01:00
v3.3.0 at sf.net/projects/pubsub
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3,17 +3,17 @@ Setup pubsub for the *arg1* message protocol. In a default pubsub installation
|
||||
the default protocol is *kargs*.
|
||||
|
||||
This module must be imported before the first ``from pubsub import pub``
|
||||
statement in the application. Once :mod:pub has been imported, the messaging
|
||||
protocol cannot be changed (i.e., importing it after the first
|
||||
``from pubsub import pub`` statement has undefined behavior).
|
||||
statement in the application. Once :mod:pub has been imported, the messaging
|
||||
protocol must not be changed (i.e., importing it after the first
|
||||
``from pubsub import pub`` statement has undefined behavior).
|
||||
::
|
||||
|
||||
from .. import setuparg1
|
||||
from .. import pub
|
||||
|
||||
The *arg1* protocol is identical to the legacy messaging protocol from
|
||||
first version of pubsub (when it was still part of wxPython) and
|
||||
is *deprecated*. This module is therefore *deprecated*.
|
||||
The *arg1* protocol is identical to the legacy messaging protocol from
|
||||
first version of pubsub (when it was still part of wxPython) and
|
||||
is *deprecated*. This module is therefore *deprecated*.
|
||||
"""
|
||||
|
||||
"""
|
||||
@@ -24,10 +24,24 @@ is *deprecated*. This module is therefore *deprecated*.
|
||||
from . import policies
|
||||
policies.msgDataProtocol = 'arg1'
|
||||
|
||||
import sys
|
||||
sys.stdout.write("""
|
||||
|
||||
======================================================================
|
||||
*** ATTENTION ***
|
||||
This messaging protocol is deprecated. This module, and hence arg1
|
||||
messaging protocol, will be removed in v3.4 of PyPubSub. Please make
|
||||
the necessary changes to your code so that it no longer requires this
|
||||
module. The pypubsub documentation provides steps that may be useful
|
||||
to minimize the chance of introducing bugs in your application.
|
||||
======================================================================
|
||||
|
||||
""")
|
||||
|
||||
|
||||
def enforceArgName(commonName):
|
||||
"""This will configure pubsub to require that all listeners use
|
||||
the same argument name (*commonName*) as first parameter. This
|
||||
is a ueful first step in migrating an application that has been
|
||||
"""This will configure pubsub to require that all listeners use
|
||||
the same argument name (*commonName*) as first parameter. This
|
||||
is a ueful first step in migrating an application that has been
|
||||
using *arg1* protocol to the more powerful *kwargs* protocol. """
|
||||
policies.setMsgDataArgName(1, commonName)
|
||||
|
||||
Reference in New Issue
Block a user