[CMF-checkins] CVS: Products/CMFCore - TypesTool.py:1.81

Yvo Schubbe y.2004_ at wcm-solutions.de
Sun Nov 7 12:05:08 EST 2004


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv8753/CMFCore

Modified Files:
	TypesTool.py 
Log Message:
- replaced 'all_meta_types' by the filtered 'all'
- simplified code


=== Products/CMFCore/TypesTool.py 1.80 => 1.81 ===
--- Products/CMFCore/TypesTool.py:1.80	Thu Oct  7 07:19:04 2004
+++ Products/CMFCore/TypesTool.py	Sun Nov  7 12:05:08 2004
@@ -648,6 +648,9 @@
     security.declareProtected(ManagePortal, 'manage_aliases')
     manage_aliases = PageTemplateFile( 'typesAliases.zpt', _wwwdir )
 
+    #
+    #   ObjectManager methods
+    #
     def all_meta_types(self):
         """Adds TypesTool-specific meta types."""
         all = TypesTool.inheritedAttribute('all_meta_types')(self)
@@ -662,12 +665,11 @@
             allowed[name] = 1
 
         all = TypesTool.inheritedAttribute('filtered_meta_types')(self)
-        meta_types = []
-        for meta_type in self.all_meta_types():
-            if allowed.get(meta_type['name']):
-                meta_types.append(meta_type)
-        return meta_types
+        return tuple( [ mt for mt in all if mt['name'] in allowed ] )
 
+    #
+    #   other methods
+    #
     security.declareProtected(ManagePortal, 'listDefaultTypeInformation')
     def listDefaultTypeInformation(self):
         # Scans for factory_type_information attributes



More information about the CMF-checkins mailing list