[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services - ConfigurationInterfaces.py:1.12

Steve Alexander steve@cat-box.net
Sun, 22 Dec 2002 16:18:12 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services
In directory cvs.zope.org:/tmp/cvs-serv7053/lib/python/Zope/App/OFS/Services

Modified Files:
	ConfigurationInterfaces.py 
Log Message:
Refactored interfaces into IFooConfigurationInfo and IFooConfiguration
interfaces, liek we have in the adapters and views services. This makes
autogenerating forms much easier.
Changed 'label' from a Field into a plain Attribute, as it should be
defined by a Configuration class, not presented as an editable field.
Added an explanatory comment to explain what label was for, and how
it is to be used. Well, it confused me to begin with!


=== Zope3/lib/python/Zope/App/OFS/Services/ConfigurationInterfaces.py 1.11 => 1.12 ===
--- Zope3/lib/python/Zope/App/OFS/Services/ConfigurationInterfaces.py:1.11	Sun Dec 22 12:25:46 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/ConfigurationInterfaces.py	Sun Dec 22 16:18:12 2002
@@ -71,18 +71,22 @@
         """
 
 
-class INamedConfiguration(IConfiguration):
+class INamedConfigurationInfo(Interface):
     """Configuration object that is registered by name
     """
 
-    name = Attribute("The name that is registered")
+    name = TextLine(title=u"Name",
+                    description=u"The name that is registered")
 
-    label = TextLine(title=u"Label",
-                     description=u"Descriptive label of the configuration"
-                                 u" type (e.g. Service, Connection)")
+    # The label is generally set as a class attribute on the
+    # configuration class.
+    label = Attribute("Descriptive label of the configuration type "
+                      "(for example, Service, Connection)")
 
+class INamedConfiguration(INamedConfigurationInfo, IConfiguration):
+    pass
 
-class INamedComponentConfiguration(INamedConfiguration):
+class INamedComponentConfigurationInfo(INamedConfigurationInfo):
     """Configuration object that configures a component associated with a name
     """
 
@@ -91,10 +95,11 @@
 
     componentPath = Attribute("The physical path to the component")
 
+class INamedComponentConfiguration(INamedComponentConfigurationInfo,
+                                   INamedConfiguration):
     def getComponent():
         """Return the component named in the configuration.
         """
-
 
 class IConfigurationRegistry(Interface):
     """A registry of configurations for a set of parameters