[Zope3-checkins] CVS: Zope3/src/zope/app/utility - configure.zcml:1.6 interfaces.py:1.6 vocabulary.py:1.3

Garrett Smith garrett at mojave-corp.com
Fri May 7 19:21:13 EDT 2004


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

Modified Files:
	configure.zcml interfaces.py vocabulary.py 
Log Message:
Added a new vocabulary to represent the set of interfaces provided by
a utility registration's component object. This replaces the use of the
'Object Interfaces' vocabulary in the IUtilityRegistration schema, which was
using the interfaces provided by the registration object. 


=== Zope3/src/zope/app/utility/configure.zcml 1.5 => 1.6 ===
--- Zope3/src/zope/app/utility/configure.zcml:1.5	Fri Apr 30 12:45:31 2004
+++ Zope3/src/zope/app/utility/configure.zcml	Fri May  7 19:21:13 2004
@@ -1,32 +1,36 @@
 <configure 
-    xmlns="http://namespaces.zope.org/zope"
-    xmlns:fssync="http://namespaces.zope.org/fssync">
+  xmlns="http://namespaces.zope.org/zope"
+  xmlns:fssync="http://namespaces.zope.org/fssync">
 
-<content class=".LocalUtilityService">
-  <factory
-      id="zope.app.services.UtilityService"
-      />
-  <require
-    permission="zope.ManageServices"
-    attributes="queryRegistrations"
-    />
-  <require
+  <content class=".LocalUtilityService">
+    
+    <factory id="zope.app.services.UtilityService" />
+    
+    <require
       permission="zope.ManageServices"
-      interface="zope.app.registration.interfaces.IRegistry"
-      />
-</content>
-
-<content class=".UtilityRegistration">
-  <require
-    permission="zope.ManageServices"
-    interface="zope.app.utility.interfaces.IUtilityRegistration"
-    set_schema="zope.app.utility.interfaces.IUtilityRegistration"
-    />
- </content>
+      attributes="queryRegistrations" />
+      
+    <require
+      permission="zope.ManageServices"
+      interface="zope.app.registration.interfaces.IRegistry" />
+      
+  </content>
 
-<fssync:adapter
+  <content class=".UtilityRegistration">
+    
+    <require
+      permission="zope.ManageServices"
+      interface="zope.app.utility.interfaces.IUtilityRegistration"
+      set_schema="zope.app.utility.interfaces.IUtilityRegistration" />
+      
+   </content>
+  
+  <fssync:adapter
     class=".UtilityRegistration"
-    factory="zope.app.registration.registration.ComponentRegistrationAdapter"
-    />
+    factory="zope.app.registration.registration.ComponentRegistrationAdapter" />
+    
+  <vocabulary
+    name="Utility Component Interfaces"
+    factory=".vocabulary.UtilityComponentInterfacesVocabulary" />
 
 </configure>


=== Zope3/src/zope/app/utility/interfaces.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/utility/interfaces.py:1.5	Sat Apr 24 19:17:59 2004
+++ Zope3/src/zope/app/utility/interfaces.py	Fri May  7 19:21:13 2004
@@ -27,8 +27,7 @@
         zope.component.interfaces.IUtilityService,
         IRegistry,
         ):
-    """Local Utility Service
-    """
+    """Local Utility Service."""
 
 class IUtilityRegistration(IComponentRegistration):
     """Utility registration object.
@@ -46,11 +45,11 @@
         )
 
     interface = Choice(
-        title = _("Provided interface"),
-        description = _("The interface provided by the utility"),
-        vocabulary="Object Interfaces",
-        readonly = True,
-        required = True,
+        title=_("Provided interface"),
+        description=_("The interface provided by the utility"),
+        vocabulary="Utility Component Interfaces",
+        readonly=True,
+        required=True,
         )
 
     componentPath = ComponentPath(


=== Zope3/src/zope/app/utility/vocabulary.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/utility/vocabulary.py:1.2	Mon Apr 26 19:58:41 2004
+++ Zope3/src/zope/app/utility/vocabulary.py	Fri May  7 19:21:13 2004
@@ -25,6 +25,7 @@
 from zope.schema.interfaces import ITokenizedTerm
 
 from zope.app import zapi
+from zope.app.interface.vocabulary import ObjectInterfacesVocabulary
 
 
 class UtilityQuery(object):
@@ -232,3 +233,10 @@
     def __len__(self):
         """See zope.schema.interfaces.IIterableVocabulary"""
         return len(self._terms)
+        
+
+class UtilityComponentInterfacesVocabulary(ObjectInterfacesVocabulary):
+    
+    def __init__(self, registration):
+        super(UtilityComponentInterfacesVocabulary, self).__init__(
+            registration.getComponent())
\ No newline at end of file




More information about the Zope3-Checkins mailing list