[CMF-checkins] CVS: CMF/CMFCore - ActionProviderBase.py:1.15.4.1

Yvo Schubbe schubbe@web.de
Sun, 12 Jan 2003 07:48:49 -0500


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

Modified Files:
      Tag: yuppie-buglets1-branch
	ActionProviderBase.py 
Log Message:
listActions returns always a sequence:
- simplified code (merged from chrism-actions-branch)
- updated copyright statement

=== CMF/CMFCore/ActionProviderBase.py 1.15 => 1.15.4.1 ===
--- CMF/CMFCore/ActionProviderBase.py:1.15	Wed Dec 18 15:03:54 2002
+++ CMF/CMFCore/ActionProviderBase.py	Sun Jan 12 07:48:46 2003
@@ -1,14 +1,15 @@
 ##############################################################################
 #
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+# Copyright (c) 2002, 2003 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 """ Implement a shared base for tools which provide actions.
 
@@ -17,7 +18,6 @@
 
 from Globals import DTMLFile
 from AccessControl import ClassSecurityInfo
-from OFS.SimpleItem import SimpleItem
 
 from ActionInformation import ActionInformation
 from CMFCorePermissions import ManagePortal
@@ -36,7 +36,7 @@
 
     security = ClassSecurityInfo()
 
-    _actions = ()
+    _actions = []
     _actions_form = DTMLFile( 'editToolsActions', _dtmldir )
 
     manage_options = ( { 'label' : 'Actions'
@@ -64,23 +64,22 @@
         """ Show the 'Actions' management tab.
         """
         actions = []
-        if self.listActions() is not None:
 
-            for a in self.listActions():
+        for a in self.listActions():
 
-                a1 = {}
-                a1['id'] = a.getId()
-                a1['name'] = a.Title()
-                p = a.getPermissions()
-                if p:
-                    a1['permission'] = p[0]
-                else:
-                    a1['permission'] = ''
-                a1['category'] = a.getCategory() or 'object'
-                a1['visible'] = a.getVisibility()
-                a1['action'] = a.getActionExpression()
-                a1['condition'] = a.getCondition()
-                actions.append(a1)
+            a1 = {}
+            a1['id'] = a.getId()
+            a1['name'] = a.Title()
+            p = a.getPermissions()
+            if p:
+                a1['permission'] = p[0]
+            else:
+                a1['permission'] = ''
+            a1['category'] = a.getCategory() or 'object'
+            a1['visible'] = a.getVisibility()
+            a1['action'] = a.getActionExpression()
+            a1['condition'] = a.getCondition()
+            actions.append(a1)
 
         # possible_permissions is in AccessControl.Role.RoleManager.
         pp = self.possible_permissions()