[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/services - query.py:1.11 registration.py:1.18

Jim Fulton jim at zope.com
Sat Mar 6 15:07:05 EST 2004


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

Modified Files:
	query.py registration.py 
Log Message:
Got rid of NamedRegistrations.


=== Zope3/src/zope/app/interfaces/services/query.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/interfaces/services/query.py:1.10	Sat Jun 21 17:22:10 2003
+++ Zope3/src/zope/app/interfaces/services/query.py	Sat Mar  6 15:06:34 2004
@@ -16,9 +16,11 @@
 $Id$
 """
 
+import zope.schema
+from zope.app.i18n import ZopeMessageIDFactory as _
 from zope.interface import Interface, Attribute
 from zope.app.security.permission import PermissionField
-from zope.app.interfaces.services.registration import INamedRegistration
+from zope.app.interfaces.services.registration import IRegistration
 from zope.app.component.interfacefield import InterfacesField
 from zope.schema.interfaces import ITuple
 # There's another import further down
@@ -27,7 +29,9 @@
     """Field for entering a pipeline of query processors."""
 
 class IQueryProcessable(Interface):
-    """Marker interface that says that the implementing component is adaptable
+    """Query Processor
+
+    Marker interface that says that the implementing component is adaptable
     to IQueryProcessor, although maybe only via a named adapter."""
 
 class IQueryProcessor(IQueryProcessable):
@@ -59,13 +63,8 @@
 class IQueryListItem(Interface):
 
     id = Attribute('The id of this query.')
-    #permission = Attribute('Permission required to run the query.'
-    #                       ' An object, not an id.')
-    #inputInterfaces = Attribute('Sequence of interfaces the input must be'
-    #                            ' adaptable to.')
-    #outputInterfaces = Attribute('Sequence of interfaces the output must be'
-    #                             ' adaptable to.')
-    permission = PermissionField(title=u'Required permission', required=False)
+    permission = PermissionField(title=u'Required permission',
+                                 required=False)
 
     inputInterfaces = InterfacesField(title=u'Input interfaces',
                                       basetype=None)
@@ -75,9 +74,19 @@
 # The import is here to avoid circular imports
 from zope.app.services.queryfield import QueryProcessorsField
 
-class IQueryRegistration(INamedRegistration):
+class IQueryRegistration(IRegistration):
+
+    name = zope.schema.TextLine(
+        title=_("Name"),
+        description=_("The name that is registered"),
+        readonly=True,
+        # Don't allow empty or missing name:
+        required=True,
+        min_length=1,
+        )
 
-    permission = PermissionField(title=u'Required permission', required=False)
+    permission = PermissionField(title=u'Required permission',
+                                 required=False)
     inputInterfaces = InterfacesField(title=u'Input interfaces',
                                       basetype=None)
     outputInterfaces = InterfacesField(title=u'Output interfaces',


=== Zope3/src/zope/app/interfaces/services/registration.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/interfaces/services/registration.py:1.17	Wed Mar  3 05:38:46 2004
+++ Zope3/src/zope/app/interfaces/services/registration.py	Sat Mar  6 15:06:34 2004
@@ -107,24 +107,6 @@
         """
 
 
-class INamedRegistration(IRegistration):
-    """Registration object that is registered only by name.
-    """
-
-    name = TextLine(
-        title=_("Name"),
-        description=_("The name that is registered"),
-        readonly=True,
-        # Don't allow empty or missing name:
-        required=True,
-        min_length=1,
-        )
-
-    # The label is generally set as a class attribute on the
-    # registration class.
-    label = Attribute("Descriptive label of the registration type "
-                      "(for example, Service, Connection)")
-
 class IComponentPath(ITextLine):
     """A component path
     """
@@ -159,9 +141,22 @@
         """
 
 
-class INamedComponentRegistration(INamedRegistration,
-                                  IComponentRegistration):
+class INamedComponentRegistration(IComponentRegistration):
     """Components registered by name, using componemt path and permission."""
+
+    name = TextLine(
+        title=_("Name"),
+        description=_("The name that is registered"),
+        readonly=True,
+        # Don't allow empty or missing name:
+        required=True,
+        min_length=1,
+        )
+
+    # The label is generally set as a class attribute on the
+    # registration class.
+    label = Attribute("Descriptive label of the registration type "
+                      "(for example, Service, Connection)")
 
 
 class IRegistrationStack(Interface):




More information about the Zope3-Checkins mailing list