[Zope3-checkins] CVS: Zope3/src/zope/app/services - connection.py:1.17 interface.py:1.11 module.zcml:1.3 servicenames.py:1.8
Sidnei da Silva
sidnei@x3ng.com.br
Thu, 3 Jul 2003 18:46:52 -0400
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv1282/src/zope/app/services
Modified Files:
connection.py interface.py module.zcml servicenames.py
Log Message:
Whitespace cleanup, changed some ContextMethods by zapi.ContextMethod, use constant for service name, corrected some labels on SQLScript. There was this ugly code on zope.app.rdb that I couldnt figure out how to fix. I need help from srichter.
=== Zope3/src/zope/app/services/connection.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/services/connection.py:1.16 Sun Jun 22 20:31:31 2003
+++ Zope3/src/zope/app/services/connection.py Thu Jul 3 18:46:15 2003
@@ -22,9 +22,10 @@
from zope.app.interfaces.services.connection import IConnectionRegistration
from zope.app.interfaces.services.connection import ILocalConnectionService
from zope.app.interfaces.services.service import ISimpleService
+from zope.app.services.servicenames import SQLDatabaseConnections
from zope.app.services.registration import NameComponentRegistry
from zope.app.services.registration import NamedComponentRegistration
-from zope.context import ContextMethod
+from zope.app import zapi
from zope.interface import implements
class ConnectionService(Persistent, NameComponentRegistry):
@@ -38,12 +39,12 @@
dbadapter = self.queryActiveComponent(name)
if dbadapter is not None:
return dbadapter()
- service = queryNextService(self, "SQLDatabaseConnections")
+ service = queryNextService(self, SQLDatabaseConnections)
if service is not None:
return service.getConnection(name)
raise KeyError, name
- getConnection = ContextMethod(getConnection)
+ getConnection = zapi.ContextMethod(getConnection)
def queryConnection(self, name, default=None):
'See IConnectionService'
@@ -52,7 +53,7 @@
except KeyError:
return default
- queryConnection = ContextMethod(queryConnection)
+ queryConnection = zapi.ContextMethod(queryConnection)
def getAvailableConnections(self):
'See IConnectionService'
@@ -61,7 +62,7 @@
registry = self.queryRegistrations(name)
if registry.active() is not None:
connections[name] = 0
- service = queryNextService(self, "SQLDatabaseConnections")
+ 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
@@ -71,7 +72,7 @@
connections[name] = 0
return connections.keys()
- getAvailableConnections = ContextMethod(getAvailableConnections)
+ getAvailableConnections = zapi.ContextMethod(getAvailableConnections)
class ConnectionRegistration(NamedComponentRegistration):
@@ -80,7 +81,7 @@
implements(IConnectionRegistration)
- serviceType = 'SQLDatabaseConnections'
+ serviceType = SQLDatabaseConnections
label = "Connection"
=== Zope3/src/zope/app/services/interface.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/services/interface.py:1.10 Wed Jul 2 11:23:05 2003
+++ Zope3/src/zope/app/services/interface.py Thu Jul 3 18:46:15 2003
@@ -53,13 +53,13 @@
class LocalInterfaceService(object):
"""A local interface service."""
-
+
implements(IInterfaceService,
ISimpleService)
# All the methods defined here are context methods
zapi.ContextAwareDescriptors()
-
+
def getInterface(self, id):
# Return the interface registered for the given id
i = self.queryInterface(id)
=== Zope3/src/zope/app/services/module.zcml 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/module.zcml:1.2 Mon Jun 30 12:24:58 2003
+++ Zope3/src/zope/app/services/module.zcml Thu Jul 3 18:46:15 2003
@@ -17,7 +17,7 @@
factory=".module.ModuleAdapter"
/>
-<adapter
+<adapter
for="zope.app.interfaces.services.folder.ISiteManagementFolder"
provides="zope.app.interfaces.file.IFileFactory"
name=".py"
=== Zope3/src/zope/app/services/servicenames.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/servicenames.py:1.7 Wed Jul 2 07:02:17 2003
+++ Zope3/src/zope/app/services/servicenames.py Thu Jul 3 18:46:15 2003
@@ -30,3 +30,4 @@
Translation = 'Translation'
DAVSchema = 'DAVSchema'
PrincipalAnnotation = 'PrincipalAnnotation'
+SQLDatabaseConnections = 'SQLDatabaseConnections'