[CMF-checkins] CVS: Products/CMFCore - ActionsTool.py:1.56 CatalogTool.py:1.62

Yvo Schubbe y.2005- at wcm-solutions.de
Mon Apr 11 06:43:44 EDT 2005


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

Modified Files:
	ActionsTool.py CatalogTool.py 
Log Message:
simplified code a bit


=== Products/CMFCore/ActionsTool.py 1.55 => 1.56 ===
--- Products/CMFCore/ActionsTool.py:1.55	Tue Jan 25 14:49:41 2005
+++ Products/CMFCore/ActionsTool.py	Mon Apr 11 06:43:44 2005
@@ -193,16 +193,11 @@
                           'global':[],
                           'workflow':[],
                           }
+
         for action in actions:
-            category = action['category']
-            catlist = filtered_actions.get(category, None)
-            if catlist is None:
-                filtered_actions[category] = catlist = []
+            catlist = filtered_actions.setdefault(action['category'], [])
             catlist.append(action)
-            # ...should you need it, here's some code that filters
-            # by equality (use instead of the line above)
-            #if not action in catlist:
-            #    catlist.append(action)
+
         return filtered_actions
 
 InitializeClass(ActionsTool)


=== Products/CMFCore/CatalogTool.py 1.61 => 1.62 ===
--- Products/CMFCore/CatalogTool.py:1.61	Thu Apr  7 12:38:46 2005
+++ Products/CMFCore/CatalogTool.py	Mon Apr 11 06:43:44 2005
@@ -241,8 +241,7 @@
                 if kw.has_key(k):
                     range = kw[k]['range'] or ''
                     query = kw[k]['query']
-                    if (not isinstance(query, tuple) and
-                        not isinstance(query, list)):
+                    if not isinstance(query, (tuple, list)):
                         query = (query,)
                 else:
                     range = ''



More information about the CMF-checkins mailing list