I recall some issue on this but can't find but the final solution is for this.
I had in my module mypublisher.py:
from wx.lib.pubsub import Publisher
# variables instead of strings for topics
statusText = 1 # pass status text in data section
dataNeedsSaving = 2 # pass parent's name in data section to limit propagation, e.g. self.parent.Name
etc etc
def SetDefaults():
global publisher
publisher = Publisher()
SetDefaults()
I change it to:
import wx.lib.pubsub.setupv1
from wx.lib.pubsub import pub
#variable stuff
def SetDefaults():
global publisher
## publisher = Publisher()
publisher = pub.Publisher()
SetDefaults()
This works when I run it in e.g. Boa, but after I generate it with py2exe I get the following exception:
**** Fri Aug 06 11:25:28 2010 **** Version: 3.1.747.9 **** wxV: 2.8.11.0 (msw-unicode) *****
Traceback (most recent call last):
File "twcb.py", line 1497, in <module>
File "twcb.py", line 1493, in main
File "wx\_core.pyo", line 7978, in __init__
File "wx\_core.pyo", line 7552, in _BootstrapApp
File "twcb.py", line 341, in OnInit
File "twcbF.pyo", line 41, in create
File "twcbF.pyo", line 230, in __init__
File "wx\lib\pubsub\core\publisherbase.pyo", line 141, in subscribe
File "wx\lib\pubsub\core\topicmgr.pyo", line 173, in getOrCreateTopic
File "wx\lib\pubsub\core\topicmgr.pyo", line 107, in getTopic
File "wx\lib\pubsub\core\topicutils.pyo", line 98, in stringize
TopicNameInvalid: Topic name 1 invalid:
Can someone please point me to the doc/resolution on how I need to change mypublisher.py to keep using version 1 of pubsub.
Thanks
Werner