dabo Commit
Revision 5938
Date: 2010-07-27 12:04:44 -0700 (Tue, 27 Jul 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5938

Changed:
U   trunk/ide/CxnEditor.py

Log:
Fixed an issue where saving a file-based connection added an incorrect key to 
the connDict.

Improved the field hide/show behavior when selecting a file-based dbType value.

Got rid of some old, ugly exec code.


Diff:
Modified: trunk/ide/CxnEditor.py
===================================================================
--- trunk/ide/CxnEditor.py      2010-07-27 12:22:05 UTC (rev 5937)
+++ trunk/ide/CxnEditor.py      2010-07-27 19:04:44 UTC (rev 5938)
@@ -268,6 +268,8 @@
                self.userText.Visible = not isFileBased
                self.pwText.Visible = not isFileBased
                self.btnDbSelect.Visible = isFileBased
+               if isFileBased:
+                       self.dbText.setFocus()
                self.layout()
 
 
@@ -340,18 +342,9 @@
                                        val = self.Crypto.decrypt(dd[fld])
                                else:
                                        val = dd[fld]
-                               if isinstance(val, basestring):
-                                       val = self.escQuote(val)                
# Add quotes
-                               exec("self.%s = %s" % (fld, val) )
+                               setattr(self, fld, val)
 
 
-       def escQuote(self, val):
-               """Escape backslashes and single quotes, and wrap the result in 
single quotes."""
-               sl = "\\"
-               qt = "\'"
-               return qt + val.replace(sl, sl+sl).replace(qt, sl+qt) + qt
-
-
        def newFile(self):
                self.connFile = self.newFileName
                self.connDict = {}
@@ -514,7 +507,7 @@
                        if self.isFileBasedBackend(val["dbtype"]):
                                db = val["database"]
                                if os.path.exists(db):
-                                       val["database"] = 
self.connDict["database"] = utils.relativePath(db, 
self.Application.HomeDirectory)
+                                       val["database"] = 
utils.relativePath(db, self.Application.HomeDirectory)
                return vals
 
 



_______________________________________________
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