[CMF-checkins] CVS: CMF/CMFCore - DynamicType.py:1.22 TypesTool.py:1.67 WorkflowTool.py:1.43

Yvo Schubbe y.2004_ at wcm-solutions.de
Mon Mar 8 08:46:39 EST 2004


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

Modified Files:
	DynamicType.py TypesTool.py WorkflowTool.py 
Log Message:
- added getPortalTypeName to DynamicType interface
- marked _getPortalTypeName as deprecated alias


=== CMF/CMFCore/DynamicType.py 1.21 => 1.22 ===
--- CMF/CMFCore/DynamicType.py:1.21	Thu Feb  5 09:33:31 2004
+++ CMF/CMFCore/DynamicType.py	Mon Mar  8 08:46:07 2004
@@ -15,12 +15,13 @@
 $Id$
 """
 
+from urllib import quote
+
 from AccessControl import ClassSecurityInfo
 from Globals import InitializeClass
-from utils import getToolByName
-from urllib import quote
 
 from interfaces.Dynamic import DynamicType as IDynamicType
+from utils import getToolByName
 
 
 class DynamicType:
@@ -36,24 +37,23 @@
     security = ClassSecurityInfo()
 
     def _setPortalTypeName(self, pt):
-        '''
-        Called by portal_types during construction, records an
-        ID that will be used later to locate the correct
-        ContentTypeInformation.
-        '''
+        """ Set the portal type name.
+
+        Called by portal_types during construction, records an ID that will be
+        used later to locate the correct ContentTypeInformation.
+        """
         self.portal_type = pt
 
     security.declarePublic('getPortalTypeName')
     def getPortalTypeName(self):
-        """
-        Returns the portal type name that can be passed to portal_types.
-        If the object is uninitialized, returns None.
+        """ Get the portal type name that can be passed to portal_types.
         """
         pt = self.portal_type
         if callable( pt ):
             pt = pt()
         return pt
 
+    # deprecated alias
     _getPortalTypeName = getPortalTypeName
 
     security.declarePublic('getTypeInfo')


=== CMF/CMFCore/TypesTool.py 1.66 => 1.67 ===
--- CMF/CMFCore/TypesTool.py:1.66	Wed Mar  3 19:05:46 2004
+++ CMF/CMFCore/TypesTool.py	Mon Mar  8 08:46:07 2004
@@ -792,8 +792,8 @@
             the appropriate type info using its portal_type.
         """
         if type( contentType ) is not type( '' ):
-            if hasattr(aq_base(contentType), '_getPortalTypeName'):
-                contentType = contentType._getPortalTypeName()
+            if hasattr(aq_base(contentType), 'getPortalTypeName'):
+                contentType = contentType.getPortalTypeName()
                 if contentType is None:
                     return None
             else:


=== CMF/CMFCore/WorkflowTool.py 1.42 => 1.43 ===
--- CMF/CMFCore/WorkflowTool.py:1.42	Thu Nov 27 10:06:49 2003
+++ CMF/CMFCore/WorkflowTool.py	Mon Mar  8 08:46:07 2004
@@ -527,8 +527,8 @@
         cbt = self._chains_by_type
         if type(ob) == type(''):
             pt = ob
-        elif hasattr(aq_base(ob), '_getPortalTypeName'):
-            pt = ob._getPortalTypeName()
+        elif hasattr(aq_base(ob), 'getPortalTypeName'):
+            pt = ob.getPortalTypeName()
         else:
             pt = None
 




More information about the CMF-checkins mailing list