dabo Commit
Revision 2416
Date: 2006-11-01 12:17:11 -0800 (Wed, 01 Nov 2006)
Author: ed
Changed:
U trunk/dabo/dApp.py
U trunk/dabo/ui/uiwx/__init__.py
Log:
Switched to a better method for creating a base prefkey when none is specified.
Improved the path searching in strToBmp() so that it will look in local folders
named 'icons' or 'resources' for the named files.
Diff:
Modified: trunk/dabo/dApp.py
===================================================================
--- trunk/dabo/dApp.py 2006-11-01 17:57:31 UTC (rev 2415)
+++ trunk/dabo/dApp.py 2006-11-01 20:17:11 UTC (rev 2416)
@@ -622,8 +622,7 @@
ret = self.MainForm.BasePrefKey
except: pass
if not ret:
- st = inspect.stack()[-1][0]
- f = st.f_locals["__file__"]
+ f = inspect.stack()[-1][1]
pth = os.path.abspath(f)
if pth.endswith(".py"):
pth = pth[:-3]
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py 2006-11-01 17:57:31 UTC (rev 2415)
+++ trunk/dabo/ui/uiwx/__init__.py 2006-11-01 20:17:11 UTC (rev 2416)
@@ -1015,9 +1015,11 @@
for pth in dabo.icons.__path__]
dabopaths = [os.path.join(pth, val)
for pth in dabo.__path__]
+ localpaths = [os.path.join(os.getcwd(), pth, val)
+ for pth in ("icons", "resources")]
# Create a list of the places to search for the image, with
# the most likely choices first.
- paths = [val] + iconpaths + dabopaths
+ paths = [val] + iconpaths + dabopaths + localpaths
# See if it's a standard icon
for pth in paths:
ret = dIcons.getIconBitmap(pth, noEmptyBmp=True)
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev