[CMF-checkins] CVS: CMF/CMFCore/interfaces - ContentTypeRegistry.py:1.5

Yvo Schubbe schubbe@web.de
Mon, 6 Jan 2003 15:37:37 -0500


Update of /cvs-repository/CMF/CMFCore/interfaces
In directory cvs.zope.org:/tmp/cvs-serv20024/CMFCore/interfaces

Modified Files:
	ContentTypeRegistry.py 
Log Message:
Merged yuppie-collector096-branch:
- Cleaned up Interfaces and API Help. (Collector #96)
- Removed deprecated 'register' module and interface.

=== CMF/CMFCore/interfaces/ContentTypeRegistry.py 1.4 => 1.5 ===
--- CMF/CMFCore/interfaces/ContentTypeRegistry.py:1.4	Wed Nov 28 14:06:24 2001
+++ CMF/CMFCore/interfaces/ContentTypeRegistry.py	Mon Jan  6 15:37:31 2003
@@ -10,15 +10,28 @@
 # FOR A PARTICULAR PURPOSE
 # 
 ##############################################################################
-"""
-Declare interfaces for MIMEtype <-> Type object registry objects.
+""" Putfactory registration tool interface.
+
+$Id$
 """
 
-from Interface import Attribute, Base
+try:
+    from Interface import Interface
+except ImportError:
+    # for Zope versions before 2.6.0
+    from Interface import Base as Interface
+
+
+class ContentTypeRegistryPredicate(Interface):
+    """ Express a rule for matching a given name/typ/body.
+
+    predicateWidget -- Return a snipped of HTML suitable for editing the
+        predicate; the snippet should arrange for values to be marshalled by
+        ZPublisher as a ':record', with the ID of the predicate as the name of
+        the record.
 
-class ContentTypeRegistryPredicate(Base):
-    """\
-    Express a rule for matching a given name/typ/body.
+    The registry will call the predictate's 'edit' method, passing the fields
+    of the record.
     """
 
     def __call__(name, typ, body):
@@ -26,22 +39,9 @@
 
     def getTypeLabel():
         """ Return a human-readable label for the predicate type. """
-    
-    def edit(**kw):
-        """ Update the predicate. """
-
-    def predicateWidget():
-        """\
-        Return a snipped of HTML suitable for editing the
-        predicate;  the snippet should arrange for values
-        to be marshalled by ZPublisher as a ':record', with
-        the ID of the predicate as the name of the record.
-        
-        The registry will call the predictate's 'edit' method,
-        passing the fields of the record.
-        """
 
-class ContentTypeRegistry(Base):
+
+class ContentTypeRegistry(Interface):
     """ Registry for rules which map PUT args to a CMF Type Object. """
 
     def findTypeName(name, typ, body):