dabo Commit
Revision 4550
Date: 2008-10-05 10:01:04 -0700 (Sun, 05 Oct 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4550
Changed:
U trunk/dabo/db/dConnectInfo.py
U trunk/dabo/db/dbSQLite.py
Log:
Updates to these two files were apparently skipped in yesterday's commit.
Diff:
Modified: trunk/dabo/db/dConnectInfo.py
===================================================================
--- trunk/dabo/db/dConnectInfo.py 2008-10-05 15:16:02 UTC (rev 4549)
+++ trunk/dabo/db/dConnectInfo.py 2008-10-05 17:01:04 UTC (rev 4550)
@@ -31,7 +31,7 @@
"Port" : 3306, "Database" : "myData", "Name" :
"mainConnection"}
ci = dConnectInfo(connInfo=connDict)
- Or, finally, you can create the object and then set the props
+ Or you can create the object and then set the props
individually:
ci = dConnectInfo()
@@ -41,11 +41,14 @@
ci.PlainTextPassword = "secret"
ci.Database = "myData"
ci.Name = "mainConnection"
+
+ If you are running a remote app, should set the RemoteHost property
instead of Host. The
+ DbType will be "web".
"""
def __init__(self, connInfo=None, **kwargs):
self._baseClass = dConnectInfo
self._backendObject = None
- self._host = self._user = self._password = self._dbType =
self._database = self._port = self._name = ""
+ self._host = self._user = self._password = self._dbType =
self._database = self._port = self._name = self._remoteHost = ""
super(dConnectInfo, self).__init__(**kwargs)
if connInfo:
self.setConnInfo(connInfo)
@@ -85,7 +88,8 @@
# a valid property name, raise TypeError.
mapping = {"name": "Name", "dbtype": "DbType", "host": "Host",
"user": "User", "password": "Password",
"database": "Database",
- "plaintextpassword": "PlainTextPassword",
"port": "Port"}
+ "plaintextpassword": "PlainTextPassword",
"port": "Port",
+ "remotehost": "RemoteHost"}
for k, v in connDict.items():
prop = mapping.get(k, None)
if prop:
@@ -165,6 +169,9 @@
elif nm == "oracle":
import dbOracle
self._backendObject = dbOracle.Oracle()
+ elif nm == "web":
+ import dbWeb
+ self._backendObject = dbWeb.Web()
else:
raise ValueError, "Invalid database
type: %s." % nm
except ImportError:
@@ -199,13 +206,6 @@
self._name = val
- def _getUser(self):
- return self._user
-
- def _setUser(self, user):
- self._user = user
-
-
def _getPassword(self):
return self._password
@@ -226,6 +226,22 @@
self._port = None
+ def _getRemoteHost(self):
+ return self._remoteHost
+
+ def _setRemoteHost(self, host):
+ self._remoteHost = host
+
+
+ def _getUser(self):
+ return self._user
+
+ def _setUser(self, user):
+ self._user = user
+
+
+
+
DbType = property(_getDbType, _setDbType, None,
_("Name of the backend database type. (str)"))
@@ -248,6 +264,9 @@
Port = property(_getPort, _setPort, None,
_("The port to connect on (may not be applicable for
all databases). (int)"))
+ RemoteHost = property(_getRemoteHost, _setRemoteHost, None,
+ _("When running as a web app, this holds the host URL.
(str)"))
+
User = property(_getUser, _setUser, None,
_("The user name. (str)"))
Modified: trunk/dabo/db/dbSQLite.py
===================================================================
--- trunk/dabo/db/dbSQLite.py 2008-10-05 15:16:02 UTC (rev 4549)
+++ trunk/dabo/db/dbSQLite.py 2008-10-05 17:01:04 UTC (rev 4550)
@@ -56,6 +56,7 @@
pth = pth.decode(sys.getfilesystemencoding()).encode("utf-8")
# Need to specify "isolation_level=None" to have transactions
working correctly.
self._connection = self.dbapi.connect(pth,
factory=DictConnection, isolation_level=None)
+ self._connection.connectInfo = connectInfo
return self._connection
_______________________________________________
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]