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

Jens Vagelpohl jens at dataflake.org
Mon Nov 22 06:56:58 EST 2004


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

Modified Files:
	TypesTool.py 
Log Message:
- TypesTool: Changed the way available factory_type_informations are
  presented on the dropdown list when adding a new type from a
  filesystem FTI to the Types Tool. The new representation includes
  the "id" as set in the FTI instead of just the product name and the
  meta_type. (http://www.zope.org/Collectors/CMF/49)


=== Products/CMFCore/TypesTool.py 1.81 => 1.82 ===
--- Products/CMFCore/TypesTool.py:1.81	Sun Nov  7 12:05:08 2004
+++ Products/CMFCore/TypesTool.py	Mon Nov 22 06:56:28 2004
@@ -677,19 +677,27 @@
         res = []
         products = self.aq_acquire('_getProducts')()
         for product in products.objectValues():
+            product_id = product.getId()
+
             if hasattr(aq_base(product), 'factory_type_information'):
                 ftis = product.factory_type_information
             else:
-                package = getattr(Products, product.getId(), None)
+                package = getattr(Products, product_id, None)
                 dispatcher = getattr(package, '__FactoryDispatcher__', None)
                 ftis = getattr(dispatcher, 'factory_type_information', None)
+
             if ftis is not None:
                 if callable(ftis):
                     ftis = ftis()
+
                 for fti in ftis:
                     mt = fti.get('meta_type', None)
+                    id = fti.get('id', '')
+
                     if mt:
-                        res.append((product.getId() + ': ' + mt, fti))
+                        p_id = '%s: %s (%s)' % (product_id, id, mt)
+                        res.append( (p_id, fti) )
+
         return res
 
     _addTIForm = DTMLFile( 'addTypeInfo', _dtmldir )



More information about the CMF-checkins mailing list