[Zope3-checkins] CVS: Zope3/src/zope/app/services - utility.py:1.3 utility.zcml:1.3

Fred L. Drake, Jr. fred@zope.com
Thu, 3 Apr 2003 17:06:05 -0500


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

Modified Files:
	utility.py utility.zcml 
Log Message:
Added configuration user-interface for the local utility service.

=== Zope3/src/zope/app/services/utility.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/utility.py:1.2	Fri Mar 21 16:02:19 2003
+++ Zope3/src/zope/app/services/utility.py	Thu Apr  3 17:05:34 2003
@@ -23,6 +23,7 @@
 from zope.app.interfaces.services.configuration import IConfigurable
 from zope.app.interfaces.services.service import ISimpleService
 from zope.app.interfaces.services.utility import IUtilityConfiguration
+from zope.app.interfaces.services.utility import ILocalUtilityService
 from zope.app.services.configuration import ConfigurationRegistry
 from zope.app.services.configuration import ConfigurationStatusProperty
 from zope.app.services.configuration import ComponentConfiguration
@@ -39,7 +40,7 @@
 
 class LocalUtilityService(Persistent, ContextAware):
 
-    __implements__ = IUtilityService, IConfigurable, ISimpleService
+    __implements__ = ILocalUtilityService, IConfigurable, ISimpleService
 
     def __init__(self):
         self._utilities = PersistentDict()
@@ -91,6 +92,13 @@
             utilities.register(interface, registry)
 
         return ContextWrapper(registry, self)
+
+    def getRegisteredMatching(self):
+        L = []
+        for name in self._utilities:
+            for iface, cr in self._utilities[name].getRegisteredMatching():
+                L.append((iface, name, ContextWrapper(cr, self)))
+        return L
 
 
 class UtilityConfiguration(ComponentConfiguration):


=== Zope3/src/zope/app/services/utility.zcml 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/utility.zcml:1.2	Fri Mar 21 16:02:19 2003
+++ Zope3/src/zope/app/services/utility.zcml	Thu Apr  3 17:05:34 2003
@@ -5,22 +5,20 @@
       id="zope.app.services.UtilityService"
       permission="zope.ManageServices"
       />
+  <require
+    permission="zope.ManageServices"
+    attributes="getRegisteredMatching queryConfigurations"
+    />
 </content>
 
 <content class=".utility.UtilityConfiguration">
   <require
     permission="zope.ManageServices"
-    interface="zope.app.interfaces.services.utility.IUtilityConfiguration"
+    interface="zope.app.interfaces.services.utility.IUtilityConfiguration
+               zope.app.interfaces.container.IAddNotifiable
+               zope.app.interfaces.container.IDeleteNotifiable"
     set_schema="zope.app.interfaces.services.utility.IUtilityConfiguration"
     />
-  <require
-      permission="zope.ManageServices"
-      interface="zope.app.interfaces.container.IAddNotifiable"
-      />
-  <require
-      permission="zope.ManageServices"
-      interface="zope.app.interfaces.container.IDeleteNotifiable"
-      />
  </content>
 
 </zopeConfigure>