[CMF-checkins] CVS: CMF/CMFCore - ActionsTool.py:1.36 CatalogTool.py:1.38 ContentTypeRegistry.py:1.12

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


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

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

=== CMF/CMFCore/ActionsTool.py 1.35 => 1.36 ===
--- CMF/CMFCore/ActionsTool.py:1.35	Fri Aug 30 11:19:13 2002
+++ CMF/CMFCore/ActionsTool.py	Mon Jan  6 15:35:28 2003
@@ -35,11 +35,17 @@
 from utils import _dtmldir
 from utils import cookString
 
+from interfaces.portal_actions import portal_actions as IActionsTool
+
+
 class ActionsTool(UniqueObject, Folder, ActionProviderBase):
     """
         Weave together the various sources of "actions" which are apropos
         to the current user and context.
     """
+
+    __implements__ = (IActionsTool, ActionProviderBase.__implements__)
+
     id = 'portal_actions'
     _actions = [ActionInformation(id='folderContents'
                                 , title='Folder contents'
@@ -116,16 +122,6 @@
         if REQUEST is not None:
             return self.manage_actionProviders(self , REQUEST
                           , manage_tabs_message='Providers changed.')
-
-    #
-    #   ActionProvider interface
-    #
-    security.declarePrivate('listActions')
-    def listActions(self, info=None):
-        """
-        Return a list of actions available through the tool.
-        """
-        return self._actions
 
     #
     #   Programmatically manipulate the list of action providers


=== CMF/CMFCore/CatalogTool.py 1.37 => 1.38 ===
--- CMF/CMFCore/CatalogTool.py:1.37	Thu Oct 17 15:38:35 2002
+++ CMF/CMFCore/CatalogTool.py	Mon Jan  6 15:35:28 2003
@@ -10,13 +10,11 @@
 # FOR A PARTICULAR PURPOSE
 # 
 ##############################################################################
-
 """ Basic portal catalog.
 
 $Id$
 """
 
-
 import os
 from utils import UniqueObject, _checkPermission, _getAuthenticatedUser
 from utils import getToolByName, _dtmldir
@@ -36,9 +34,15 @@
 from CMFCorePermissions import AccessInactivePortalContent
 from Acquisition import aq_base
 
+from interfaces.portal_catalog \
+        import IndexableObjectWrapper as IIndexableObjectWrapper
+from interfaces.portal_catalog import portal_catalog as ICatalogTool
+
 
 class IndexableObjectWrapper:
 
+    __implements__ = IIndexableObjectWrapper
+
     def __init__(self, vars, ob):
         self.__vars = vars
         self.__ob = ob
@@ -71,6 +75,9 @@
 class CatalogTool (UniqueObject, ZCatalog, ActionProviderBase):
     '''This is a ZCatalog that filters catalog queries.
     '''
+
+    __implements__ = (ICatalogTool, ActionProviderBase.__implements__)
+
     id = 'portal_catalog'
     meta_type = 'CMF Catalog'
     security = ClassSecurityInfo()
@@ -96,14 +103,6 @@
     #
     #   Subclass extension interface
     #
-    security.declarePrivate('listActions')
-    def listActions(self, info=None):
-        """
-        Return a list of action information instances 
-        provided via tool
-        """
-        return self._actions
-
     security.declarePublic( 'enumerateIndexes' ) # Subclass can call
     def enumerateIndexes( self ):
         #   Return a list of ( index_name, type ) pairs for the initial


=== CMF/CMFCore/ContentTypeRegistry.py 1.11 => 1.12 ===
--- CMF/CMFCore/ContentTypeRegistry.py:1.11	Sat Aug  3 22:38:35 2002
+++ CMF/CMFCore/ContentTypeRegistry.py	Mon Jan  6 15:35:28 2003
@@ -25,11 +25,20 @@
 
 import re, os, string, urllib
 
+from interfaces.ContentTypeRegistry \
+        import ContentTypeRegistryPredicate as IContentTypeRegistryPredicate
+from interfaces.ContentTypeRegistry \
+        import ContentTypeRegistry as IContentTypeRegistry
+
+
 class MajorMinorPredicate( SimpleItem ):
     """
         Predicate matching on 'major/minor' content types.
         Empty major or minor implies wildcard (all match).
     """
+
+    __implements__ = IContentTypeRegistryPredicate
+
     major = minor = None
     PREDICATE_TYPE  = 'major_minor'
 
@@ -74,7 +83,7 @@
     #   ContentTypeRegistryPredicate interface
     #
     security.declareObjectPublic()
-    def __call__( self, name, typ, body, SLASH_SPLIT=re.compile( '/' ) ):
+    def __call__( self, name, typ, body ):
         """
             Return true if the rule matches, else false.
         """
@@ -87,7 +96,7 @@
         typ = typ or '/'
         if not '/' in typ:
             typ = typ + '/'
-        major, minor = SLASH_SPLIT.split( typ )
+        major, minor = typ.split('/', 1)
 
         if self.major and not major in self.major:
             return 0
@@ -113,6 +122,9 @@
     """
         Predicate matching on filename extensions.
     """
+
+    __implements__ = IContentTypeRegistryPredicate
+
     extensions = None
     PREDICATE_TYPE  = 'extension'
 
@@ -174,6 +186,9 @@
         string patterns (other objects conforming to 'match' can
         also be passed).
     """
+
+    __implements__ = IContentTypeRegistryPredicate
+
     pattern         = None
     PREDICATE_TYPE  = 'mimetype_regex'
 
@@ -227,6 +242,9 @@
         for string patterns (other objects conforming to 'match'
         and 'pattern' can also be passed).
     """
+
+    __implements__ = IContentTypeRegistryPredicate
+
     pattern         = None
     PREDICATE_TYPE  = 'name_regex'
 
@@ -298,6 +316,9 @@
     """
         Registry for rules which map PUT args to a CMF Type Object.
     """
+
+    __implements__ = IContentTypeRegistry
+
     meta_type = 'Content Type Registry'
     id = 'content_type_registry'