dabo Commit
Revision 6093
Date: 2010-10-07 21:12:59 -0700 (Thu, 07 Oct 2010)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6093

Changed:
U   trunk/dabo/__init__.py
U   trunk/dabo/lib/connParser.py
U   trunk/ide/wizards/AppWizard/AppWizard.py
U   trunk/ide/wizards/AppWizard/spec-main.exe.manifest
UU  trunk/ide/wizards/AppWizard/spec-sampleReport.rfxml
U   trunk/ide/wizards/AppWizard/spec-setup.py.txt

Log:
Fixed the XML generated from the Appwizard to use utf-8, as it was failing with 
'1252' on Windows for the cnxml, samplereport.rfxml, and the manifest file.

Diff:
Modified: trunk/dabo/__init__.py
===================================================================
--- trunk/dabo/__init__.py      2010-10-08 01:56:08 UTC (rev 6092)
+++ trunk/dabo/__init__.py      2010-10-08 04:12:59 UTC (rev 6093)
@@ -144,7 +144,15 @@
                ret = defaultEncoding
        return ret
 
+def getXMLEncoding():
+       ret = getEncoding()
+       if ret.lower().strip().replace("-", "") == "utf8":
+               return "utf-8"
+       if "1252" in ret:
+               return "windows-1252"
+       return ret
 
+
 # These are the various standard log handlers.
 consoleLogHandler = fileLogHandler = None
 dbConsoleLogHandler = dbFileLogHandler = None

Modified: trunk/dabo/lib/connParser.py
===================================================================
--- trunk/dabo/lib/connParser.py        2010-10-08 01:56:08 UTC (rev 6092)
+++ trunk/dabo/lib/connParser.py        2010-10-08 04:12:59 UTC (rev 6093)
@@ -98,12 +98,12 @@
        return ret
 
 
-def createXML(cxns):
+def createXML(cxns, encoding=None):
        """ Returns the XML for the passed connection info. The info
        can either be a single dict of connection info, or a list/tuple of
        such dicts.
        """
-       ret = getXMLWrapper()
+       ret = getXMLWrapper(encoding=encoding)
        cxml = ""
        if isinstance(cxns, (list, tuple)):
                for cx in cxns:
@@ -150,7 +150,9 @@
        return ret
 
 
-def getXMLWrapper():
+def getXMLWrapper(encoding=None):
+       if encoding is None:
+               encoding = dabo.getXMLEncoding()
        return """<?xml version="1.0" encoding="%s" standalone="yes"?>
 <connectiondefs xmlns="http://www.dabodev.com";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
@@ -160,7 +162,7 @@
 %s
 
 </connectiondefs>
-""" % (dabo.getEncoding(), "%s")
+""" % (encoding, "%s")
 
 
 def getConnTemplate():

Modified: trunk/ide/wizards/AppWizard/AppWizard.py
===================================================================
--- trunk/ide/wizards/AppWizard/AppWizard.py    2010-10-08 01:56:08 UTC (rev 
6092)
+++ trunk/ide/wizards/AppWizard/AppWizard.py    2010-10-08 04:12:59 UTC (rev 
6093)
@@ -662,7 +662,6 @@
                        os.chmod('go.sh',stat.S_IRWXU )  ## rwx for user, 
nothing else.
 
                        ## Create the manifest file (for xp theme support):
-                       enc = dabo.getEncoding()
                        pth = os.path.join(self.wizDir, 
"spec-main.exe.manifest")
                        txt = open(pth).read() % locals()
                        open("./%s.exe.manifest" % appName, "w").write(txt)
@@ -1066,7 +1065,7 @@
                                "database" : ci.Database, "user" : ci.User,
                                "password" : ci.Password, "port" : ci.Port,
                                "name" : ci.Name}
-               return createXML(cxnDict)
+               return createXML(cxnDict, encoding="utf-8")
 
 
        def getBaseBizobj(self):
@@ -1148,7 +1147,6 @@
 
 
        def getSampleReport(self):
-               enc = dabo.getEncoding()
                return open(os.path.join(self.wizDir,
                                "spec-sampleReport.rfxml")).read() % locals()
 

Modified: trunk/ide/wizards/AppWizard/spec-main.exe.manifest
===================================================================
--- trunk/ide/wizards/AppWizard/spec-main.exe.manifest  2010-10-08 01:56:08 UTC 
(rev 6092)
+++ trunk/ide/wizards/AppWizard/spec-main.exe.manifest  2010-10-08 04:12:59 UTC 
(rev 6093)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="%(enc)s" standalone="yes"?>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
   <assemblyIdentity
     version="5.0.0.0"

Modified: trunk/ide/wizards/AppWizard/spec-sampleReport.rfxml
===================================================================
--- trunk/ide/wizards/AppWizard/spec-sampleReport.rfxml 2010-10-08 01:56:08 UTC 
(rev 6092)
+++ trunk/ide/wizards/AppWizard/spec-sampleReport.rfxml 2010-10-08 04:12:59 UTC 
(rev 6093)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="%(enc)s" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 
 <report>
        <page>


Property changes on: trunk/ide/wizards/AppWizard/spec-sampleReport.rfxml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/ide/wizards/AppWizard/spec-setup.py.txt
===================================================================
--- trunk/ide/wizards/AppWizard/spec-setup.py.txt       2010-10-08 01:56:08 UTC 
(rev 6092)
+++ trunk/ide/wizards/AppWizard/spec-setup.py.txt       2010-10-08 04:12:59 UTC 
(rev 6093)
@@ -113,10 +113,11 @@
 if sys.platform.startswith("win"):
        options = {"py2exe":
                        {"packages": ["encodings", "wx", "ui", "biz", "db"],
-                               #"optimize": 1, #compressed: 1,
+                               "optimize": 2, "compressed": 1,
                                "excludes": ["Tkconstants", "Tkinter", "tcl",
                                                "_imagingtk", "PIL._imagingtk",
                                                "ImageTk", "PIL.ImageTk", 
"FixTk"],
+                               "dll_excludes": ["msvcp90.dll"],
                                "typelibs" : 
[('{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}', 0, 1, 1)]
                        }}
 



_______________________________________________
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