dabo Commit
Revision 4275
Date: 2008-07-13 11:46:58 -0700 (Sun, 13 Jul 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4275
Changed:
U trunk/dabo/dLocalize.py
Log:
Updated the getDaboLocaleDir() method to work with py2app-built files.
Diff:
Modified: trunk/dabo/dLocalize.py
===================================================================
--- trunk/dabo/dLocalize.py 2008-07-13 17:30:02 UTC (rev 4274)
+++ trunk/dabo/dLocalize.py 2008-07-13 18:46:58 UTC (rev 4275)
@@ -88,16 +88,23 @@
def getDaboLocaleDir():
- localeDir = os.path.join(os.path.split(dabo.__file__)[0], "locale")
+ localeDirName = "locale"
+ localeDir = os.path.join(os.path.split(dabo.__file__)[0], localeDirName)
if not os.path.isdir(localeDir):
# Frozen app?
- # First need to find the directory that contains the .exe:
+ # First need to find the directory that contains the
executable. On the Mac,
+ # it might be a directory at a lower level than dabo itself.
startupDir = localeDir
while startupDir:
- startupDir = os.path.split(startupDir)[0]
- if os.path.isdir(startupDir):
+ newDir = os.path.split(startupDir)[0]
+ if newDir == startupDir:
+ # At the root dir
break
- localeDir = os.path.join(startupDir, "dabo.locale")
+ startupDir = newDir
+ candidate = os.path.join(startupDir, localeDirName)
+ if os.path.isdir(candidate):
+ break
+ localeDir = candidate
return localeDir
_______________________________________________
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]