[CMF-checkins] SVN: CMF/trunk/CMFCore/PortalFolder.py - minor code modernization

Yvo Schubbe y.2006_ at wcm-solutions.de
Mon Apr 24 14:20:10 EDT 2006


Log message for revision 67574:
  - minor code modernization

Changed:
  U   CMF/trunk/CMFCore/PortalFolder.py

-=-
Modified: CMF/trunk/CMFCore/PortalFolder.py
===================================================================
--- CMF/trunk/CMFCore/PortalFolder.py	2006-04-24 17:57:50 UTC (rev 67573)
+++ CMF/trunk/CMFCore/PortalFolder.py	2006-04-24 18:20:09 UTC (rev 67574)
@@ -148,7 +148,7 @@
             # We'll modify it, work on a copy.
             filt = filt.copy()
         pt = filt.get('portal_type', [])
-        if type(pt) is type(''):
+        if isinstance(pt, basestring):
             pt = [pt]
         types_tool = getToolByName(self, 'portal_types')
         allowed_types = types_tool.listContentTypes()
@@ -553,14 +553,14 @@
                 self.description.append( 'Modified before: %s' % modified )
 
         if Type:
-            if type( Type ) == type( '' ):
-                Type = [ Type ]
+            if isinstance(Type, basestring):
+                Type = [Type]
             self.predicates.append( lambda x, Type=Type:
                                       x.Type() in Type )
             self.description.append( 'Type: %s' % ', '.join(Type) )
 
         if portal_type and portal_type is not self.MARKER:
-            if type(portal_type) is type(''):
+            if isinstance(portal_type, basestring):
                 portal_type = [portal_type]
             self.predicates.append( lambda x, pt=portal_type:
                                     hasattr(aq_base(x), 'getPortalTypeName')



More information about the CMF-checkins mailing list