[Zope3-checkins] CVS: Zope3/src/zope/app/services - configure.zcml:1.68 interface.py:1.21 interface.zcml:NONE

Suresh Babu Eddala sbabu at zeomega.com
Fri Mar 5 10:56:48 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv12256/src/zope/app/services

Modified Files:
	configure.zcml interface.py 
Removed Files:
	interface.zcml 
Log Message:


LocalInterfaceService is removed




=== Zope3/src/zope/app/services/configure.zcml 1.67 => 1.68 ===
--- Zope3/src/zope/app/services/configure.zcml:1.67	Wed Mar  3 05:38:51 2004
+++ Zope3/src/zope/app/services/configure.zcml	Fri Mar  5 10:56:17 2004
@@ -349,9 +349,6 @@
   permission="zope.ManageContent"
   />
 
-<!-- Local Interface Service -->
-<include file="interface.zcml" />
-
 <!-- Local Module Support -->
 <include file="module.zcml" />
 


=== Zope3/src/zope/app/services/interface.py 1.20 => 1.21 ===
--- Zope3/src/zope/app/services/interface.py:1.20	Fri Feb 20 17:02:24 2004
+++ Zope3/src/zope/app/services/interface.py	Fri Mar  5 10:56:17 2004
@@ -11,10 +11,9 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""Code about services and interfaces.
+"""Code about interfaces.
 
-This module contains code for interfaces in persistent modules, and
-for the local interface service.
+This module contains code for interfaces in persistent modules.
 
 $Id$
 """
@@ -23,18 +22,7 @@
 from persistent.dict import PersistentDict
 from zodbcode.patch import registerWrapper, Wrapper
 from zope.interface.interface import InterfaceClass
-from zope.interface.interfaces import IInterface
-from zope.interface import Interface, providedBy
-from zope.component import getService
-from zope.app.component.nextservice import getNextService
-from zope.app.interfaces.services.service import ISimpleService
-from zope.app.interfaces.component import IInterfaceService
-from zope.app import zapi
-from zope.app.services.servicenames import Interfaces, Utilities
-from zope.component import ComponentLookupError
-from zope.interface import implements
-from zope.app.container.contained import Contained
-from zope.app.interfaces.services.registration import IRegistrationStack
+from zope.interface import Interface
 
 class PersistentInterfaceClass(Persistent, InterfaceClass):
 
@@ -69,71 +57,3 @@
                 lambda iface: (),
                 getInterfaceStateForPersistentInterfaceCreation,
                 )
-
-
-class LocalInterfaceService(Contained):
-    """A local interface service."""
-
-    implements(IInterfaceService,
-               ISimpleService)
-
-    def getInterface(self, id):
-        # Return the interface registered for the given id
-        i = self.queryInterface(id)
-        if i is None:
-            raise ComponentLookupError(id)
-        return i
-
-    def queryInterface(self, id, default=None):
-        # Return the interface registered for the given id
-        next = getNextService(self, Interfaces)
-        iface = next.queryInterface(id, default)
-        if iface is default:
-            utilities = self._queryUtilityInterfaces(search_string=id)
-            if utilities:
-                return utilities[0][1]
-            return default
-        return iface
-
-    def searchInterface(self, search_string="", base=None):
-        # Return the interfaces that match the search criteria
-        ifaces = {}
-        next = getNextService(self, Interfaces)
-        for iface in next.searchInterface(search_string, base):
-            ifaces[iface] = None
-        for item in self._queryUtilityInterfaces(base, search_string):
-            if not ifaces.has_key(item[1]):
-                ifaces[item[1]] = None
-        return ifaces.keys()
-
-    def searchInterfaceIds(self, search_string="", base=None):
-        # Return the ids of the interfaces that match the search criteria.
-        ids = {}
-        next = getNextService(self, Interfaces)
-        for id in next.searchInterfaceIds(search_string, base):
-            ids[id] = None
-        for item in self._queryUtilityInterfaces(base, search_string):
-            if not ids.has_key(item[0]):
-                ids[item[0]] = None
-        return ids.keys()
-
-    def items(self, search_string="", base=None):
-        # Return id, interface pairs for all items matching criteria.
-        items = {}
-        next = getNextService(self, Interfaces)
-        for item in next.items(search_string, base):
-            items[item] = None
-        for item in self._queryUtilityInterfaces(base, search_string):
-            if not items.has_key(item):
-                items[item] = None
-        return items.keys()
-
-    def _queryUtilityInterfaces(self, interface=None, search_string=None):
-        utilities = getService(self, Utilities)
-        matching = utilities.getUtilitiesFor(interface)
-        matching = [m for m in matching
-                    if IInterface in providedBy(m[1])]
-        if search_string is not None:
-            return [match for match in matching
-                    if match[0].find(search_string) > -1]
-        return matching

=== Removed File Zope3/src/zope/app/services/interface.zcml ===




More information about the Zope3-Checkins mailing list