[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnue-common/src GConnections.py GDataSourc...
From: |
Jason Cater |
Subject: |
gnue/gnue-common/src GConnections.py GDataSourc... |
Date: |
Thu, 13 Sep 2001 18:21:00 -0400 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 01/09/13 18:21:00
Modified files:
gnue-common/src: GConnections.py GDataSource.py
Log message:
Simplified login methods
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GConnections.py.diff?cvsroot=OldCVS&tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GDataSource.py.diff?cvsroot=OldCVS&tr1=1.13&tr2=1.14&r1=text&r2=text
Patches:
Index: gnue/gnue-common/src/GConnections.py
diff -u gnue/gnue-common/src/GConnections.py:1.13
gnue/gnue-common/src/GConnections.py:1.14
--- gnue/gnue-common/src/GConnections.py:1.13 Wed Sep 12 15:03:04 2001
+++ gnue/gnue-common/src/GConnections.py Thu Sep 13 18:21:00 2001
@@ -141,14 +141,12 @@
#
# Get a data connection for a specified database
#
- def setDataConnection(self, dataSource):
- connection_name = dataSource.database
- dataObject = dataSource.getDataObject()
- if self._openConnections.has_key(string.lower(connection_name)):
+ def setDataConnection(self, dataObject, connection):
+ connection_name = string.lower(connection)
+ if self._openConnections.has_key(connection_name):
# If a database connetion has already been established, use it
- dataSource.getDataObject().setDataConnection(self._openConnections[ \
- string.lower(connection_name)])
+ dataObject.setDataConnection(self._openConnections[connection_name])
GDebug.printMesg(5,'Reusing data connection to %s' % connection_name)
else:
@@ -162,17 +160,17 @@
# Ask the UI to prompt for our login data
loginData = self._loginHandler.getLogin(
[connection_name,
self.getConnectionParameter(connection_name,'comment',''),
- dataSource.getDataObject().getLoginFields()])
+ dataObject.getLoginFields()])
# Add the parameters from the Connections Definition File
loginData.update(self.getConnectionParameters(connection_name))
# Ask the data object to connect to the database
- dataSource.getDataObject().connect(loginData)
+ dataObject.connect(loginData)
# Save the newly opened connection for future datasources
- self._openConnections[string.lower(connection_name)] = \
- dataSource.getDataObject().getDataConnection()
+ self._openConnections[connection_name] = \
+ dataObject.getDataConnection()
# We're done!
attempts = 0
Index: gnue/gnue-common/src/GDataSource.py
diff -u gnue/gnue-common/src/GDataSource.py:1.13
gnue/gnue-common/src/GDataSource.py:1.14
--- gnue/gnue-common/src/GDataSource.py:1.13 Sun Sep 9 19:24:04 2001
+++ gnue/gnue-common/src/GDataSource.py Thu Sep 13 18:21:00 2001
@@ -91,7 +91,8 @@
def connect(self):
if self.database != None:
- self._connectionManager.setDataConnection(self)
+ self._connectionManager.\
+ setDataConnection(self._dataObject, self.database)
def getDataObject(self):
return self._dataObject
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/gnue-common/src GConnections.py GDataSourc...,
Jason Cater <=