daboide Commit
Revision 842
Date: 2007-05-07 15:13:52 -0700 (Mon, 07 May 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/daboide/changeset/842

Changed:
U   trunk/CxnEditor.py

Log:
Only store a relative path for the database if it is a file-based backend. 
Tracker [1024].


Diff:
Modified: trunk/CxnEditor.py
===================================================================
--- trunk/CxnEditor.py  2007-04-26 11:07:50 UTC (rev 841)
+++ trunk/CxnEditor.py  2007-05-07 22:13:52 UTC (rev 842)
@@ -234,15 +234,19 @@
                self.enableControls()
                self.update()
 
-
+       
+       def isFileBasedBackend(self, dbtype):
+               return dbtype in ("SQLite", )
+               
+               
        def enableControls(self):
                dbt = self.dbtype
-               isSQLite = (dbt == "SQLite")
-               self.hostText.Visible = not isSQLite
-               self.portText.Visible = not isSQLite
-               self.userText.Visible = not isSQLite
-               self.pwText.Visible = not isSQLite
-               self.btnDbSelect.Visible = isSQLite
+               isFileBased = self.isFileBasedBackend(dbt)
+               self.hostText.Visible = not isFileBased
+               self.portText.Visible = not isFileBased
+               self.userText.Visible = not isFileBased
+               self.pwText.Visible = not isFileBased
+               self.btnDbSelect.Visible = isFileBased
                self.layout()
                        
                if self.defDbPorts[dbt] is None:
@@ -476,9 +480,10 @@
        
        def relPaths(self, vals):
                for val in vals:
-                       db = val["database"]
-                       if os.path.exists(db):
-                               val["database"] = utils.relativePath(db, 
self.connFile)
+                       if self.isFileBasedBackend(val["dbtype"]):
+                               db = val["database"]
+                               if os.path.exists(db):
+                                       val["database"] = 
utils.relativePath(db, self.connFile)
                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/dabo-dev/[EMAIL PROTECTED]

Reply via email to