dabo Commit
Revision 2325
Date: 2006-10-09 17:54:00 -0700 (Mon, 09 Oct 2006)
Author: ed
Changed:
U trunk/dabo/dApp.py
Log:
Added the attribute 'dbConnectionNameToFiles'. This is a dict that maps the
connection names loaded into the app object to the files containing the
connection definition.
Diff:
Modified: trunk/dabo/dApp.py
===================================================================
--- trunk/dabo/dApp.py 2006-10-10 00:52:39 UTC (rev 2324)
+++ trunk/dabo/dApp.py 2006-10-10 00:54:00 UTC (rev 2325)
@@ -379,7 +379,8 @@
self.uiResources = {}
# Initialize DB collections
- self.dbConnectionDefs = {}
+ self.dbConnectionDefs = {}
+ self.dbConnectionNameToFiles = {}
self.dbConnections = {}
self._appInfo = {}
@@ -399,12 +400,18 @@
if os.path.exists(dbDir) and os.path.isdir(dbDir):
files = glob.glob(os.path.join(dbDir,
"*.cnxml"))
for f in files:
- connDefs.update(importConnections(f))
+ cn = importConnections(f)
+ connDefs.update(cn)
+ for kk in cn.keys():
+
self.dbConnectionNameToFiles[kk] = f
# Import any python code connection definitions (the "old" way).
try:
import dbConnectionDefs
- connDefs.update(dbConnectionDefs.getDefs())
+ defs = dbConnectionDefs.getDefs()
+ connDefs.update(defs)
+ for kk in defs.keys():
+ self.dbConnectionNameToFiles[kk] =
os.abspath("dbConnectionDefs.py")
except:
pass
@@ -475,6 +482,7 @@
# Use a default name
name = "[EMAIL PROTECTED]" % (ci.User, ci.Host)
self.dbConnectionDefs[name] = ci
+ self.dbConnectionNameToFiles[name] = None
def addConnectFile(self, connFile):
@@ -501,6 +509,7 @@
ci = dabo.db.dConnectInfo()
ci.setConnInfo(v)
self.dbConnectionDefs[k] = ci
+ self.dbConnectionNameToFiles[k] = connFile
########################
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev