dabo Commit
Revision 4320
Date: 2008-07-24 15:07:44 -0700 (Thu, 24 Jul 2008)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/4320

Changed:
U   trunk/dabo/dLocalize.py

Log:
[4275] broke Dabo working with py2exe applications that set the dabo locale dir 
to 'dabo.locale/', such as those applications generated with the AppWizard. 
This fixes my issue, but Ed please test with tweezer to see if it messes your 
stuff up.

Diff:
Modified: trunk/dabo/dLocalize.py
===================================================================
--- trunk/dabo/dLocalize.py     2008-07-24 21:27:08 UTC (rev 4319)
+++ trunk/dabo/dLocalize.py     2008-07-24 22:07:44 UTC (rev 4320)
@@ -88,23 +88,26 @@
 
 
 def getDaboLocaleDir():
-       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 
executable. On the Mac,
-               # it might be a directory at a lower level than dabo itself.
-               startupDir = localeDir
-               while startupDir:
-                       newDir = os.path.split(startupDir)[0]
-                       if newDir == startupDir:
-                               # At the root dir
-                               break
-                       startupDir = newDir
-                       candidate = os.path.join(startupDir, localeDirName)
+       localeDirNames = ("dabo.locale", "locale")
+       for localeDirName in localeDirNames:
+               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 
executable. On the Mac,
+                       # it might be a directory at a lower level than dabo 
itself.
+                       startupDir = localeDir
+                       while startupDir:
+                               newDir = os.path.split(startupDir)[0]
+                               if newDir == startupDir:
+                                       # At the root dir
+                                       break
+                               startupDir = newDir
+                               candidate = os.path.join(startupDir, 
localeDirName)
+                               if os.path.isdir(candidate):
+                                       break
                        if os.path.isdir(candidate):
+                               localeDir = 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]

Reply via email to