dabo Commit
Revision 6413
Date: 2011-02-08 10:13:44 -0800 (Tue, 08 Feb 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6413

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

Log:
Since it's not possible to load UI layer from within ui package because of 
existing cross references,
I moved this code to the dabo package.
It's very useful feature under IDE, e.g. to make autocomplete working.

Diff:
Modified: trunk/dabo/__init__.py
===================================================================
--- trunk/dabo/__init__.py      2011-02-08 17:13:08 UTC (rev 6412)
+++ trunk/dabo/__init__.py      2011-02-08 18:13:44 UTC (rev 6413)
@@ -413,3 +413,19 @@
        os.chmod("main.py", 0744)
        os.chdir(currLoc)
        print "Application '%s' has been created for you" % homedir
+
+
+# Automatically load a default UI if the environmental variable exists.
+# If the DABO_DEFAULT_UI exists, that ui will be loaded into the dabo.ui
+# global namespace. This is really only meant as a convenience for the
+# dabo developers when rolling single-file distributions - we don't want
+# everyone setting this environment variable. To specify the UI for your
+# app, you should instead set the UI property of the dApp object.
+# We can't do this from within the ui package because of the corss references.
+try:
+       __defaultUI = os.environ["DABO_DEFAULT_UI"]
+except KeyError:
+       __defaultUI = None
+else:
+       dabo.log.info("Automatically loading default ui '%s'..." % __defaultUI)
+       dabo.ui.loadUI(__defaultUI)

Modified: trunk/dabo/ui/__init__.py
===================================================================
--- trunk/dabo/ui/__init__.py   2011-02-08 17:13:08 UTC (rev 6412)
+++ trunk/dabo/ui/__init__.py   2011-02-08 18:13:44 UTC (rev 6413)
@@ -72,32 +72,6 @@
        return retVal
 
 
-# Automatically load a default UI if the environmental variable exists.
-# If the DABO_DEFAULT_UI exists, that ui will be loaded into the dabo.ui
-# global namespace. This is really only meant as a convenience for the
-# dabo developers when rolling single-file distributions - we don't want
-# everyone setting this environment variable. To specify the UI for your
-# app, you should instead set the UI property of the dApp object.
-try:
-       __defaultUI = os.environ["DABO_DEFAULT_UI"]
-except KeyError:
-       __defaultUI = None
-
-if __defaultUI:
-       dabo.log.info(_("Automatically loading default ui '%s'...") % 
__defaultUI)
-       # For now, don't do the tempting option:
-       #loadUI(defaultUI)
-       # ...unless it will work with single-file installers. I think that
-       # for single-file installers, it needs to see the import statement.
-       # Therefore, do it explicitly:
-       if __defaultUI in ("wx", "wxPython", "uiwx"):
-               from uiwx import *
-else:
-       pass
-       #dabo.log.info(_("No default UI set. (DABO_DEFAULT_UI)"))
-
-
-
 def getEventData(uiEvent):
        """ Given a UI-specific event object, return a UI-agnostic name/value 
dictionary.
 



_______________________________________________
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/[email protected]

Reply via email to