dabo Commit
Revision 3097
Date: 2007-04-30 12:09:04 -0700 (Mon, 30 Apr 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/3097

Changed:
U   trunk/dabo/ui/uiwx/__init__.py

Log:
Fixed the import problem with dDockForm for versions of wxPython < 2.7.

Improved the code that creates the art constants.


Diff:
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py      2007-04-30 16:28:04 UTC (rev 3096)
+++ trunk/dabo/ui/uiwx/__init__.py      2007-04-30 19:09:04 UTC (rev 3097)
@@ -138,19 +138,20 @@
 from dLed import dLed
 import dUICursors as dUICursors
 import dShell
-from dDockForm import dDockForm
 
 try:
        from dGlWindow import dGlWindow
 except ImportError:
        dabo.infoLog.write(_("PyOpenGL not present, so dGlWindow is not 
loaded."))
 
+# dDockForm is not available with wxPython < 2.7
+if wx.VERSION >= (2, 7):
+       from dDockForm import dDockForm
 
 artConstants = {}
-for item in dir(wx):
-       if item[:4] == "ART_":
-               daboConstant = item[4:].lower().replace("_", "")
-               artConstants[daboConstant] = getattr(wx, item)
+for item in (it for it in dir(wx) if it.startswith("ART_")):
+       daboConstant = item[4:].lower().replace("_", "")
+       artConstants[daboConstant] = getattr(wx, item)
 
 # artConstant aliases:
 artConstants["cd"] = artConstants.get("cdrom")



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to