On 9/16/11 8:37 PM, Hyeonseung I wrote:
I`m trying to make an app bundle via py2app from a project using wxPython and
it`s pub feature.
But there is a problem whenever running the app.
In my code, Publisher is imported as:
from wx.lib.pubsub import Publisher as pub
...
But when I run the app, error message is in a console:
ImportError: cannot import name Publisher
Publisher is an instance of wx.lib.pubsub.pub.PublisherClass
In other word, Publisher is NOT a module.
But in the app bundle, python try to regard 'Publisher' as module. WHY?
pubsub does some odd things in this regard.
There was a recent thread on the wxPython mailing list about this issue
-- I think the pubsub author came up with a patch. In that case it was
y2exe, but It's likely to be the same issue
You can also try the pubsub list.
-Chris
So, I tried to change my code:
import wx.lib.pubsub as ppp
pub = ppp.Publisher
......
pub.subscribe(self.OnImageUpdated, 'image.updated')
.....
In this case, error massage is like this:
AttributeError: 'module' object has no attribute 'Publisher'
What`s the problem?
_______________________________________________
Pythonmac-SIG maillist - Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
chris.bar...@noaa.gov
_______________________________________________
Pythonmac-SIG maillist - Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG