dabo Commit
Revision 6200
Date: 2010-11-22 08:32:34 -0800 (Mon, 22 Nov 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6200
Changed:
U trunk/dabo/__init__.py
Log:
Changed the placement of the getEncoding() and getXMLEncoding() methods in the
file. If no default encoding is set when the 'import dLocalize' is called, an
error is thrown because dLocalize tries to call getEncoding(), which had not
yet been defined. With this change, getEncoding() is now defined before
dLocalize tries to call it.
Diff:
Modified: trunk/dabo/__init__.py
===================================================================
--- trunk/dabo/__init__.py 2010-11-21 15:47:01 UTC (rev 6199)
+++ trunk/dabo/__init__.py 2010-11-22 16:32:34 UTC (rev 6200)
@@ -127,17 +127,6 @@
# we want to make them part of the dabo namespace.
from settings import *
-# Install localization service for dabo. dApp will install localization service
-# for the user application separately.
-import dLocalize
-dLocalize.install("dabo")
-# On some platforms getfilesystemencoding() and even getdefaultlocale()
-# can return None, so we make sure we always set a reasonable encoding:
-# NOTE: 'defaultEncoding' is imported from 'from settings import *' line above.
-fileSystemEncoding = (sys.getfilesystemencoding()
- or locale.getdefaultlocale()[1] or defaultEncoding)
-
-
def getEncoding():
ret = locale.getlocale()[1]
if ret is None:
@@ -153,6 +142,17 @@
return ret
+# Install localization service for dabo. dApp will install localization service
+# for the user application separately.
+import dLocalize
+dLocalize.install("dabo")
+# On some platforms getfilesystemencoding() and even getdefaultlocale()
+# can return None, so we make sure we always set a reasonable encoding:
+# NOTE: 'defaultEncoding' is imported from 'from settings import *' line above.
+fileSystemEncoding = (sys.getfilesystemencoding()
+ or locale.getdefaultlocale()[1] or defaultEncoding)
+
+
# These are the various standard log handlers.
consoleLogHandler = fileLogHandler = None
dbConsoleLogHandler = dbFileLogHandler = None
_______________________________________________
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]