[Zope3-checkins] CVS: Zope3/src/zope/app/services - adapter.py:1.17 auth.py:1.19 cache.py:1.11 configuration.py:1.31 connection.py:1.13 errorr.py:1.10 event.py:1.27 field.py:1.8 hub.py:1.13 principalannotation.py:1.9 service.py:1.23 session.py:1.10 view.py:1.22 zpt.py:1.13
Steve Alexander
steve@cat-box.net
Sat, 7 Jun 2003 01:32:31 -0400
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv27624/src/zope/app/services
Modified Files:
adapter.py auth.py cache.py configuration.py connection.py
errorr.py event.py field.py hub.py principalannotation.py
service.py session.py view.py zpt.py
Log Message:
new interface declarations
=== Zope3/src/zope/app/services/adapter.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/services/adapter.py:1.16 Sun Jun 1 11:59:36 2003
+++ Zope3/src/zope/app/services/adapter.py Sat Jun 7 01:31:58 2003
@@ -21,6 +21,7 @@
from zope.interface.adapter import AdapterRegistry
from persistence import Persistent
from persistence.dict import PersistentDict
+from zope.interface import implements
from zope.component.interfaces import IAdapterService
from zope.component.exceptions import ComponentLookupError
from zope.component import getServiceManager
@@ -44,7 +45,7 @@
class AdapterService(Persistent):
- __implements__ = IAdapterService, IConfigurable, ISimpleService
+ implements(IAdapterService, IConfigurable, ISimpleService)
def __init__(self):
self._byName = PersistentDict()
@@ -188,7 +189,7 @@
class AdapterConfiguration(SimpleConfiguration):
- __implements__ = IAdapterConfiguration, SimpleConfiguration.__implements__
+ implements(IAdapterConfiguration)
status = ConfigurationStatusProperty(Adapters)
=== Zope3/src/zope/app/services/auth.py 1.18 => 1.19 ===
--- Zope3/src/zope/app/services/auth.py:1.18 Wed Jun 4 12:02:09 2003
+++ Zope3/src/zope/app/services/auth.py Sat Jun 7 01:31:58 2003
@@ -35,6 +35,7 @@
from zope.app.component.nextservice import getNextService
from zope.context import ContextMethod
from zope.app.interfaces.services.service import ISimpleService
+from zope.interface import implements
class DuplicateLogin(Exception):
@@ -46,7 +47,7 @@
class AuthenticationService(Persistent):
- __implements__ = IAuthenticationService, IContainer, ISimpleService
+ implements(IAuthenticationService, IContainer, ISimpleService)
def __init__(self):
self._usersbylogin = OOBTree()
@@ -160,11 +161,10 @@
return key in self._usersbyid
-
class User(Persistent):
"""A persistent implementation of the IUser interface """
- __implements__ = IAnnotatableUser
+ implements(IAnnotatableUser)
def __init__(self, id, title, description, login, pw):
self.__id = id
=== Zope3/src/zope/app/services/cache.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/services/cache.py:1.10 Tue May 27 10:18:24 2003
+++ Zope3/src/zope/app/services/cache.py Sat Jun 7 01:31:58 2003
@@ -33,6 +33,7 @@
from zope.app.services.configuration import NameComponentConfigurable
from zope.app.services.configuration import NamedComponentConfiguration
from zope.app.services.event import ServiceSubscriberEventChannel
+from zope.interface import implements
class ILocalCachingService(ICachingService, IEventChannel,
INameComponentConfigurable):
@@ -41,9 +42,7 @@
class CachingService(ServiceSubscriberEventChannel, NameComponentConfigurable):
- __implements__ = (ILocalCachingService,
- ISimpleService,
- ServiceSubscriberEventChannel.__implements__)
+ implements(ILocalCachingService, ISimpleService)
_subscribeToServiceInterface = IObjectModifiedEvent
@@ -94,8 +93,7 @@
__doc__ = ICacheConfiguration.__doc__
- __implements__ = (ICacheConfiguration,
- NamedComponentConfiguration.__implements__)
+ implements(ICacheConfiguration)
status = ConfigurationStatusProperty('Caching')
=== Zope3/src/zope/app/services/configuration.py 1.30 => 1.31 ===
--- Zope3/src/zope/app/services/configuration.py:1.30 Tue Jun 3 10:26:57 2003
+++ Zope3/src/zope/app/services/configuration.py Sat Jun 7 01:31:58 2003
@@ -274,7 +274,7 @@
Classes that derive from this must make sure they implement
IDeleteNotifiable either by implementing
- SimpleConfiguration.__implements__ or explicitly implementing
+ implementedBy(SimpleConfiguration) or explicitly implementing
IDeleteNotifiable.
"""
=== Zope3/src/zope/app/services/connection.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/services/connection.py:1.12 Tue May 27 10:18:24 2003
+++ Zope3/src/zope/app/services/connection.py Sat Jun 7 01:31:58 2003
@@ -24,12 +24,13 @@
from zope.app.component.nextservice import queryNextService
from zope.app.services.configuration import NameComponentConfigurable
+from zope.interface import implements
class ConnectionService(Persistent, NameComponentConfigurable):
__doc__ = ILocalConnectionService.__doc__
- __implements__ = ILocalConnectionService, ISimpleService
+ implements(ILocalConnectionService, ISimpleService)
def getConnection(self, name):
'See IConnectionService'
@@ -80,8 +81,7 @@
__doc__ = IConnectionConfiguration.__doc__
- __implements__ = (IConnectionConfiguration,
- NamedComponentConfiguration.__implements__)
+ implements(IConnectionConfiguration)
status = ConfigurationStatusProperty('SQLDatabaseConnections')
=== Zope3/src/zope/app/services/errorr.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/services/errorr.py:1.9 Tue May 27 10:18:24 2003
+++ Zope3/src/zope/app/services/errorr.py Sat Jun 7 01:31:58 2003
@@ -27,6 +27,7 @@
from zope.context import ContextMethod
from zope.app.interfaces.services.error import IErrorReportingService
from zope.app.interfaces.services.service import ISimpleService
+from zope.interface import implements
#Restrict the rate at which errors are sent to the Event Log
@@ -49,7 +50,7 @@
class ErrorReportingService(Persistent):
"""Error Reporting Service
"""
- __implements__ = IErrorReportingService, ISimpleService
+ implements(IErrorReportingService, ISimpleService)
keep_entries = 20
copy_to_zlog = 0
=== Zope3/src/zope/app/services/event.py 1.26 => 1.27 ===
--- Zope3/src/zope/app/services/event.py:1.26 Wed May 28 11:46:11 2003
+++ Zope3/src/zope/app/services/event.py Sat Jun 7 01:31:58 2003
@@ -33,6 +33,7 @@
from zope.context import ContextMethod, ContextSuper
from zope.proxy import removeAllProxies
+from zope.interface import implements
from zope.app.event.subs import Subscribable, SubscriptionTracker
@@ -77,7 +78,7 @@
class EventChannel(Subscribable):
- __implements__ = IEventChannel
+ implements(IEventChannel)
# needs __init__ from zope.app.event.subs.Subscribable
@@ -139,11 +140,7 @@
event service when bound, and unsubscribe when unbound.
"""
- __implements__ = (
- EventChannel.__implements__,
- SubscriptionTracker.__implements__,
- IBindingAware
- )
+ implements(IBindingAware)
def __init__(self):
SubscriptionTracker.__init__(self)
@@ -241,8 +238,6 @@
those of the next higher service.
"""
- __implements__ = Subscribable.__implements__
-
_serviceName = None # should be replaced; usually done in "bound"
# method of a subclass that is IBindingAware
@@ -318,13 +313,7 @@
class EventService(ServiceSubscriberEventChannel, ServiceSubscribable):
- __implements__ = (
- IEventService,
- ISubscriptionService,
- ISimpleService,
- ServiceSubscribable.__implements__,
- ServiceSubscriberEventChannel.__implements__
- )
+ implements(IEventService, ISubscriptionService, ISimpleService)
def __init__(self):
ServiceSubscriberEventChannel.__init__(self)
=== Zope3/src/zope/app/services/field.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/field.py:1.7 Thu Mar 13 12:10:37 2003
+++ Zope3/src/zope/app/services/field.py Sat Jun 7 01:31:58 2003
@@ -25,10 +25,11 @@
from zope.app.interfaces.services.field import IComponentLocation
from zope.component import getServiceManager, getAdapter
from zope.app.interfaces.services.module import IModuleService
+from zope.interface import implements
class ComponentPath(Field):
- __implements__ = IComponentPath
+ implements(IComponentPath)
_type = unicode
@@ -52,7 +53,7 @@
class ComponentLocation(Field):
- __implements__ = IComponentLocation
+ implements(IComponentLocation)
_type = unicode
=== Zope3/src/zope/app/services/hub.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/services/hub.py:1.12 Wed May 28 11:46:11 2003
+++ Zope3/src/zope/app/services/hub.py Sat Jun 7 01:31:58 2003
@@ -45,6 +45,7 @@
from zope.app.interfaces.services.hub import IObjectRemovedHubEvent
from zope.app.interfaces.traversing import ITraverser
from zope.app.interfaces.services.service import ISimpleService
+from zope.interface import implements
class HubEvent:
"""Convenient mix-in for HubEvents"""
@@ -83,7 +84,7 @@
class ObjectRegisteredHubEvent(HubEvent):
"""A hubid has been freshly created and mapped against an object."""
- __implements__ = IObjectRegisteredHubEvent
+ implements(IObjectRegisteredHubEvent)
class ObjectUnregisteredHubEvent:
@@ -103,7 +104,7 @@
self.__object = object
self.location = location
- __implements__ = IObjectUnregisteredHubEvent
+ implements(IObjectUnregisteredHubEvent)
def __getObject(self):
obj = self.__object
@@ -118,7 +119,7 @@
class ObjectModifiedHubEvent(HubEvent):
"""An object with a hubid has been modified."""
- __implements__ = IObjectModifiedHubEvent
+ implements(IObjectModifiedHubEvent)
class ObjectMovedHubEvent(HubEvent):
@@ -129,13 +130,13 @@
self.fromLocation = fromLocation
HubEvent.__init__(self, hub, hubid, location, object)
- __implements__ = IObjectMovedHubEvent
+ implements(IObjectMovedHubEvent)
class ObjectRemovedHubEvent(ObjectUnregisteredHubEvent):
"""An object with a hubid has been removed."""
- __implements__ = IObjectRemovedHubEvent
+ implements(IObjectRemovedHubEvent)
# ...which is a subclass of IObjectUnregisteredHubEvent
hub = None
@@ -171,10 +172,7 @@
# concerned, and if it doesn't know how to do something, it won't
# ask anything else to try. Everything else is YAGNI for now.
- __implements__ = (
- IObjectHub,
- ISimpleService,
- ServiceSubscriberEventChannel.__implements__)
+ implements(IObjectHub, ISimpleService)
def __init__(self):
ServiceSubscriberEventChannel.__init__(self)
=== Zope3/src/zope/app/services/principalannotation.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/services/principalannotation.py:1.8 Sun Jun 1 11:59:36 2003
+++ Zope3/src/zope/app/services/principalannotation.py Sat Jun 7 01:31:58 2003
@@ -26,6 +26,7 @@
from zope.context import ContextMethod
from zope.app.context import ContextWrapper
from zope.app.interfaces.annotation import IAnnotations
+from zope.interface import implements
# Sibling imports
from zope.app.interfaces.services.principalannotation \
@@ -38,8 +39,7 @@
The service ID is 'PrincipalAnnotation'.
"""
- __implements__ = (IPrincipalAnnotationService, Persistent.__implements__,
- ISimpleService)
+ implements(IPrincipalAnnotationService, ISimpleService)
def __init__(self):
self.annotations = OOBTree()
@@ -54,7 +54,6 @@
"""
return self.getAnnotationsById(principal.getId())
-
getAnnotations = ContextMethod(getAnnotations)
def getAnnotationsById(self, principalId):
@@ -68,7 +67,7 @@
annotations = Annotations(principalId, store=self.annotations)
return ContextWrapper(annotations, self, name=principalId)
-
+
getAnnotationsById = ContextMethod(getAnnotationsById)
def hasAnnotations(self, principal):
@@ -79,7 +78,7 @@
class Annotations(Persistent):
"""Stores annotations."""
- __implements__ = IAnnotations, Persistent.__implements__
+ implements(IAnnotations)
def __init__(self, principalId, store=None):
self.principalId = principalId
=== Zope3/src/zope/app/services/service.py 1.22 => 1.23 ===
--- Zope3/src/zope/app/services/service.py:1.22 Mon Jun 2 10:34:40 2003
+++ Zope3/src/zope/app/services/service.py Sat Jun 7 01:31:58 2003
@@ -31,6 +31,8 @@
from zodb.code.module import PersistentModule
from zodb.code.module import PersistentModuleRegistry
+from zope.interface import implements
+
from zope.component import getServiceManager
from zope.component.exceptions import ComponentLookupError
@@ -60,10 +62,7 @@
class ServiceManager(PersistentModuleRegistry, NameComponentConfigurable):
- __implements__ = (IServiceManager, IContainer,
- PersistentModuleRegistry.__implements__,
- NameComponentConfigurable.__implements__,
- IModuleService)
+ implements(IServiceManager, IContainer, IModuleService)
def __init__(self):
super(ServiceManager, self).__init__()
@@ -299,8 +298,7 @@
__doc__ = IServiceConfiguration.__doc__
- __implements__ = (IServiceConfiguration,
- NamedComponentConfiguration.__implements__)
+ implements(IServiceConfiguration)
status = ConfigurationStatusProperty('Services')
=== Zope3/src/zope/app/services/session.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/services/session.py:1.9 Tue Mar 11 11:11:22 2003
+++ Zope3/src/zope/app/services/session.py Sat Jun 7 01:31:59 2003
@@ -26,6 +26,7 @@
from persistence.dict import PersistentDict
from zope.server.http.http_date import build_http_date
from zope.component import getService
+from zope.interface import implements
# Sibling imports
from zope.app.interfaces.services.session import ISessionService
@@ -43,8 +44,7 @@
class CookieSessionService(Persistent):
"""Session service implemented using cookies."""
- __implements__ = (Persistent.__implements__, ISessionService,
- IConfigureSessionService, ISimpleService)
+ implements(ISessionService, IConfigureSessionService, ISimpleService)
def __init__(self):
self.dataManagers = PersistentDict()
=== Zope3/src/zope/app/services/view.py 1.21 => 1.22 ===
--- Zope3/src/zope/app/services/view.py:1.21 Sun Jun 1 11:59:36 2003
+++ Zope3/src/zope/app/services/view.py Sat Jun 7 01:31:59 2003
@@ -32,6 +32,7 @@
from zope.app.services.configuration import ConfigurationStatusProperty
from zope.app.component.nextservice import getNextService
from zope.component import getSkin
+from zope.interface import implements
from zope.security.checker import NamesChecker, ProxyFactory
@@ -47,7 +48,7 @@
class ViewService(Persistent):
- __implements__ = IViewService, IConfigurable, ISimpleService
+ implements(IViewService, IConfigurable, ISimpleService)
def __init__(self):
self._layers = PersistentDict()
@@ -216,7 +217,7 @@
class ViewConfiguration(SimpleConfiguration):
- __implements__ = IViewConfiguration, SimpleConfiguration.__implements__
+ implements(IViewConfiguration)
status = ConfigurationStatusProperty('Views')
@@ -249,7 +250,7 @@
class PageConfiguration(ViewConfiguration):
- __implements__ = IPageConfiguration, ViewConfiguration.__implements__
+ implements(IPageConfiguration)
# We only care about browser pages
presentationType = IBrowserPresentation
=== Zope3/src/zope/app/services/zpt.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/services/zpt.py:1.12 Thu May 29 16:50:42 2003
+++ Zope3/src/zope/app/services/zpt.py Sat Jun 7 01:31:59 2003
@@ -19,6 +19,7 @@
from persistence import Persistent
+from zope.interface import implements
from zope.security.proxy import ProxyFactory
from zope.pagetemplate.pagetemplate import PageTemplate
from zope.app.pagetemplate.engine import AppPT
@@ -30,7 +31,7 @@
class ZPTTemplate(AppPT, PageTemplate, Persistent):
- __implements__ = IZPTTemplate
+ implements(IZPTTemplate)
contentType = 'text/html'
expand = False
@@ -73,7 +74,7 @@
tag = re.compile(r"<[^>]+>")
class SearchableText:
- __implements__ = ISearchableText
+ implements(ISearchableText)
__used_for__ = IZPTTemplate
def __init__(self, page):
@@ -97,7 +98,7 @@
class ReadFile:
- __implements__ = IReadFile
+ implements(IReadFile)
def __init__(self, context):
self.context = context
@@ -107,11 +108,11 @@
def size(self):
return len(self.context.source)
-
+
class WriteFile:
- __implements__ = IWriteFile
+ implements(IWriteFile)
def __init__(self, context):
self.context = context
@@ -122,7 +123,7 @@
class ZPTFactory:
- __implements__ = IFileFactory
+ implements(IFileFactory)
def __init__(self, context):
self.context = context
@@ -136,7 +137,7 @@
class ZPTPageAdapter(ObjectEntryAdapter):
"""ObjectFile adapter for ZPTTemplate objects."""
- __implements__ = IObjectFile
+ implements(IObjectFile)
def getBody(self):
return self.context.source