dabo Commit
Revision 5512
Date: 2009-11-05 11:13:01 -0800 (Thu, 05 Nov 2009)
Author: Paul
Trac:
http://trac.dabodev.com/changeset/5512Changed:
U trunk/dabo/ui/uiwx/__init__.py
Log:
When running frozen, the nice message to install wxPython correctly isn't helpful,
because it doesn't tell the developer which sublibraries need to be included in
the distribution.
I was barking up the wrong tree all day yesterday, trying to figure out why
'import wx' was failing even though I'd included the wx package in my distribution.
Turns out that wx raises an ImportError when liblapack.so can't be found.
Diff:
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py 2009-10-29 18:27:01 UTC (rev 5511)
+++ trunk/dabo/ui/uiwx/__init__.py 2009-11-05 19:13:01 UTC (rev 5512)
@@ -16,10 +16,18 @@
# note: may need wx.animate as well
for lib in ("wx", "wx.stc", "wx.lib.foldpanelbar", "wx.gizmos",
"wx.lib.calendar", "wx.lib.masked", "wx.lib.buttons"):
- try:
+
+ if getattr(sys, "frozen", False):
+ # Just import it without catching the ImportError. This will let the
+ # developer know which libs are essential to distribute, when trying
+ # to run the exe on the target system. Could be some sub-library, not
+ # simply "wx", "wx.stc", etc.
__import__(lib)
- except ImportError:
- _failedLibs.append(lib)
+ else:
+ try:
+ __import__(lib)
+ except ImportError:
+ _failedLibs.append(lib)
if len(_failedLibs) > 0:
msg = """
_______________________________________________
Post Messages to:
Dabo-dev@...
Subscription Maintenance:
http://leafe.com/mailman/listinfo/dabo-devSearchable Archives:
http://leafe.com/archives/search/dabo-devThis message:
http://leafe.com/archives/byMID/20091105191302.3C5F3318C1F@...