[Zope3-checkins] CVS: Zope3/src/zope/app/services - connection.py:1.4
Steve Alexander
steve@cat-box.net
Fri, 17 Jan 2003 11:33:16 -0500
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv15888/src/zope/app/services
Modified Files:
connection.py
Log Message:
Removed confusing variable name, added explanatory comment for something
that was a tad confusing, removed unneeded __init__ method.
=== Zope3/src/zope/app/services/connection.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/services/connection.py:1.3 Fri Jan 3 12:46:10 2003
+++ Zope3/src/zope/app/services/connection.py Fri Jan 17 11:33:13 2003
@@ -34,14 +34,11 @@
__implements__ = ILocalConnectionService
- def __init__(self):
- super(ConnectionService, self).__init__()
-
def getConnection(self, name):
'See IConnectionService'
- adapter = self.queryActiveComponent(name)
- if adapter is not None:
- return adapter()
+ dbadapter = self.queryActiveComponent(name)
+ if dbadapter is not None:
+ return dbadapter()
service = queryNextService(self, "SQLDatabaseConnections")
if service is not None:
return service.getConnection(name)
@@ -67,6 +64,10 @@
connections[name] = 0
service = queryNextService(self, "SQLDatabaseConnections")
if service is not None:
+ # Note that this works because we're only interested in the names
+ # of connections. If we wanted other data about connections, we'd
+ # have to be careful not to override this service's connections
+ # with higher-up connections.
for name in service.getAvailableConnections():
connections[name] = 0
return connections.keys()