[Zope3-checkins] CVS: Zope3/src/zope/component - adapter.py:1.2.6.2 factory.py:1.2.6.2 interfaces.py:1.3.4.2 resource.py:1.2.6.2 service.py:1.3.6.2 skin.py:1.2.6.2 utility.py:1.2.6.2 view.py:1.2.6.2

Guido van Rossum guido@python.org
Mon, 3 Mar 2003 13:29:06 -0500


Update of /cvs-repository/Zope3/src/zope/component
In directory cvs.zope.org:/tmp/cvs-serv22756/src/zope/component

Modified Files:
      Tag: use-config-branch
	adapter.py factory.py interfaces.py resource.py service.py 
	skin.py utility.py view.py 
Log Message:
Get rid of IService.  Instead, add ILocalService, which only applies
(as the name implies) to local services.  Fewer files touched.

=== Zope3/src/zope/component/adapter.py 1.2.6.1 => 1.2.6.2 ===
--- Zope3/src/zope/component/adapter.py:1.2.6.1	Wed Feb 26 16:19:32 2003
+++ Zope3/src/zope/component/adapter.py	Mon Mar  3 13:28:33 2003
@@ -16,7 +16,7 @@
 
 from zope.interface.adapter import AdapterRegistry
 from zope.component.exceptions import ComponentLookupError
-from zope.component.interfaces import IAdapterService, IService
+from zope.component.interfaces import IAdapterService
 
 class IGlobalAdapterService(IAdapterService):
 
@@ -52,7 +52,7 @@
 
 class GlobalAdapterService:
 
-    __implements__ = IGlobalAdapterService, IService
+    __implements__ = IGlobalAdapterService
 
     def __init__(self):
         self.__adapters = {}


=== Zope3/src/zope/component/factory.py 1.2.6.1 => 1.2.6.2 ===
--- Zope3/src/zope/component/factory.py:1.2.6.1	Wed Feb 26 16:19:32 2003
+++ Zope3/src/zope/component/factory.py	Mon Mar  3 13:28:33 2003
@@ -17,7 +17,7 @@
 
 from zope.interface.verify import verifyObject
 from zope.component.interfaces import IFactory
-from zope.component.interfaces import IFactoryService, IService
+from zope.component.interfaces import IFactoryService
 from zope.component.exceptions import ComponentLookupError
 
 class IGlobalFactoryService(IFactoryService):
@@ -28,7 +28,7 @@
 
 class GlobalFactoryService:
 
-    __implements__ = IGlobalFactoryService, IService
+    __implements__ = IGlobalFactoryService
 
     def __init__(self):
         self.__factories={}


=== Zope3/src/zope/component/interfaces.py 1.3.4.1 => 1.3.4.2 ===
--- Zope3/src/zope/component/interfaces.py:1.3.4.1	Wed Feb 26 16:19:32 2003
+++ Zope3/src/zope/component/interfaces.py	Mon Mar  3 13:28:33 2003
@@ -201,10 +201,6 @@
         """
 
 
-class IService(Interface):
-    """A marker interface that all services must implement."""
-
-
 class IFactory(Interface):
 
     def __call__():


=== Zope3/src/zope/component/resource.py 1.2.6.1 => 1.2.6.2 ===
--- Zope3/src/zope/component/resource.py:1.2.6.1	Wed Feb 26 16:19:32 2003
+++ Zope3/src/zope/component/resource.py	Mon Mar  3 13:28:33 2003
@@ -19,7 +19,7 @@
 from zope.interface.implementor import ImplementorRegistry
 from zope.component.exceptions import ComponentLookupError
 from zope.component import getSkin
-from zope.component.interfaces import IResourceService, IService
+from zope.component.interfaces import IResourceService
 
 class IGlobalResourceService(IResourceService):
 
@@ -44,10 +44,10 @@
 
 class GlobalResourceService:
 
-    __implements__ = IGlobalResourceService, IService
-
     def __init__(self):
         self.__layers = {}
+
+    __implements__ = IGlobalResourceService
 
     def getResource(self, object, name, request):
         '''See interface IResourceService'''


=== Zope3/src/zope/component/service.py 1.3.6.1 => 1.3.6.2 ===
--- Zope3/src/zope/component/service.py:1.3.6.1	Wed Feb 26 16:19:32 2003
+++ Zope3/src/zope/component/service.py	Mon Mar  3 13:28:33 2003
@@ -18,9 +18,9 @@
 
 from zope.exceptions import DuplicationError
 from zope.component.interfaces import IServiceService
-from zope.component.interfaces import IService
 from zope.component.exceptions import ComponentLookupError
 
+
 class IGlobalServiceManager(IServiceService):
 
     def defineService(name, interface):
@@ -49,11 +49,6 @@
        the required interface
     """
 
-class InvalidServiceDefinition(Exception):
-    """An attempt to define a service using an interface that doesn't
-       inherit from IService.
-    """
-
 class GlobalServiceManager:
     """service manager"""
 
@@ -77,7 +72,7 @@
 
     def provideService(self, name, component, force=False):
         """see IGlobalServiceManager interface, above
-
+        
         The force keyword allows one to replace an existing
         service.  This is mostly useful in testing scenarios.
         """
@@ -90,9 +85,6 @@
 
         if not self.__defs[name].isImplementedBy(component):
             raise InvalidService(name, component, self.__defs[name])
-
-        if not IService.isImplementedBy(component):
-            raise InvalidServiceDefinition(name, component)
 
         self.__services[name] = component
 


=== Zope3/src/zope/component/skin.py 1.2.6.1 => 1.2.6.2 ===
--- Zope3/src/zope/component/skin.py:1.2.6.1	Wed Feb 26 16:19:32 2003
+++ Zope3/src/zope/component/skin.py	Mon Mar  3 13:28:33 2003
@@ -18,7 +18,7 @@
 
 from zope.interface.implementor import ImplementorRegistry
 from zope.component.exceptions import ComponentLookupError
-from zope.component.interfaces import ISkinService, IService
+from zope.component.interfaces import ISkinService
 
 class IGlobalSkinService(ISkinService):
 
@@ -32,10 +32,10 @@
 
 class GlobalSkinService:
 
-    __implements__ = IGlobalSkinService, IService
-
     def __init__(self):
         self.__skins = {}
+
+    __implements__ = IGlobalSkinService
 
     def defineSkin(self, name, view_type, layers):
         '''See interface IGlobalSkinService'''


=== Zope3/src/zope/component/utility.py 1.2.6.1 => 1.2.6.2 ===
--- Zope3/src/zope/component/utility.py:1.2.6.1	Wed Feb 26 16:19:33 2003
+++ Zope3/src/zope/component/utility.py	Mon Mar  3 13:28:33 2003
@@ -19,7 +19,6 @@
 from zope.interface.implementor import ImplementorRegistry
 from zope.component.interfaces import IUtilityService
 from zope.component.exceptions import ComponentLookupError
-from zope.app.interfaces.services.interfaces import ISimpleService
 
 class IGlobalUtilityService(IUtilityService):
 
@@ -31,7 +30,7 @@
 
 class GlobalUtilityService:
 
-    __implements__ = IGlobalUtilityService, ISimpleService
+    __implements__=IGlobalUtilityService
 
     def __init__(self):
         self.__utilities = {}


=== Zope3/src/zope/component/view.py 1.2.6.1 => 1.2.6.2 ===
--- Zope3/src/zope/component/view.py:1.2.6.1	Wed Feb 26 16:19:33 2003
+++ Zope3/src/zope/component/view.py	Mon Mar  3 13:28:33 2003
@@ -19,7 +19,7 @@
 from zope.interface.adapter import AdapterRegistry
 from zope.component.exceptions import ComponentLookupError
 from zope.component import getSkin
-from zope.component.interfaces import IViewService, IService
+from zope.component.interfaces import IViewService
 from zope.exceptions import NotFoundError
 
 class IGlobalViewService(IViewService):
@@ -39,7 +39,7 @@
 
 class GlobalViewService:
 
-    __implements__ = IGlobalViewService, IService
+    __implements__ = IGlobalViewService
 
     def __init__(self):
         self.__layers = {}