[CMF-checkins] CVS: CMF/CMFCore - URLTool.py:1.3 UndoTool.py:1.13 WorkflowTool.py:1.36 __init__.py:1.22

Yvo Schubbe schubbe@web.de
Tue, 4 Feb 2003 17:24:28 -0500


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

Modified Files:
	URLTool.py UndoTool.py WorkflowTool.py __init__.py 
Log Message:
Merged yuppie-buglets1-branch:
- Fixed buglets. (Collector #94 and #95)
- Removed string functions and useless imports.

=== CMF/CMFCore/URLTool.py 1.2 => 1.3 ===
--- CMF/CMFCore/URLTool.py:1.2	Wed Dec 11 17:21:49 2002
+++ CMF/CMFCore/URLTool.py	Tue Feb  4 17:24:25 2003
@@ -1,14 +1,15 @@
 ##############################################################################
 #
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+# Copyright (c) 2001-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
-# 
+#
 ##############################################################################
 """ CMFCore portal_url tool.
 
@@ -45,8 +46,8 @@
     security.declareObjectProtected(View)
 
     manage_options = ( ActionProviderBase.manage_options
-                     + ( {'label':'Overview'
-                         ,'action':'manage_overview'}
+                     + ( {'label':'Overview',
+                          'action':'manage_overview'}
                        ,
                        )
                      + SimpleItem.manage_options


=== CMF/CMFCore/UndoTool.py 1.12 => 1.13 ===
--- CMF/CMFCore/UndoTool.py:1.12	Mon Jan  6 15:37:20 2003
+++ CMF/CMFCore/UndoTool.py	Tue Feb  4 17:24:25 2003
@@ -1,26 +1,29 @@
 ##############################################################################
 #
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+# Copyright (c) 2001-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
-# 
+#
 ##############################################################################
 """ Basic undo tool.
 
 $Id$
 """
 
-from utils import UniqueObject, _getAuthenticatedUser, _checkPermission
-from utils import getToolByName, _dtmldir
 from OFS.SimpleItem import SimpleItem
 from Globals import InitializeClass, DTMLFile
-from string import split
 from AccessControl import ClassSecurityInfo, Unauthorized
+
+from utils import _checkPermission
+from utils import _dtmldir
+from utils import _getAuthenticatedUser
+from utils import UniqueObject
 from Expression import Expression
 from ActionInformation import ActionInformation
 from ActionProviderBase import ActionProviderBase
@@ -86,7 +89,7 @@
             user_id = _getAuthenticatedUser(self).getId()
             transactions = filter(
                 lambda record, user_id=user_id:
-                split(record['user_name'])[-1] == user_id,
+                record['user_name'].split()[-1] == user_id,
                 transactions
                 )
         return transactions


=== CMF/CMFCore/WorkflowTool.py 1.35 => 1.36 ===
--- CMF/CMFCore/WorkflowTool.py:1.35	Thu Oct 24 10:32:49 2002
+++ CMF/CMFCore/WorkflowTool.py	Tue Feb  4 17:24:25 2003
@@ -1,23 +1,22 @@
 ##############################################################################
 #
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+# Copyright (c) 2001-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
-# 
+#
 ##############################################################################
-
 """ Basic workflow tool.
 
 $Id$
 """
 
 import sys
-from string import join, split, replace, strip
 
 from OFS.Folder import Folder
 from Globals import InitializeClass, PersistentMapping, DTMLFile
@@ -30,7 +29,6 @@
 from interfaces.portal_workflow import portal_workflow
 
 from utils import UniqueObject
-from utils import _checkPermission
 from utils import getToolByName
 from utils import _dtmldir
 
@@ -147,7 +145,7 @@
             if title == id:
                 title = None
             if cbt is not None and cbt.has_key(id):
-                chain = join(cbt[id], ', ')
+                chain = ', '.join(cbt[id])
             else:
                 chain = '(Default)'
             types_info.append({'id': id,
@@ -155,7 +153,7 @@
                                'chain': chain})
         return self._manage_selectWorkflows(
             REQUEST,
-            default_chain=join(self._default_chain, ', '),
+            default_chain=', '.join(self._default_chain),
             types_info=types_info,
             management_view='Workflows',
             manage_tabs_message=manage_tabs_message)
@@ -175,15 +173,15 @@
         for t in ti:
             id = t.getId()
             field_name = 'chain_%s' % id
-            chain = strip(props.get(field_name, '(Default)'))
+            chain = props.get(field_name, '(Default)').strip()
             if chain == '(Default)':
                 # Remove from cbt.
                 if cbt.has_key(id):
                     del cbt[id]
             else:
-                chain = replace(chain, ',', ' ')
+                chain = chain.replace(',', ' ')
                 ids = []
-                for wf_id in split(chain, ' '):
+                for wf_id in chain.split(' '):
                     if wf_id:
                         if not self.getWorkflowById(wf_id):
                             raise ValueError, (
@@ -191,9 +189,9 @@
                         ids.append(wf_id)
                 cbt[id] = tuple(ids)
         # Set up the default chain.
-        default_chain = replace(default_chain, ',', ' ')
+        default_chain = default_chain.replace(',', ' ')
         ids = []
-        for wf_id in split(default_chain, ' '):
+        for wf_id in default_chain.split(' '):
             if wf_id:
                 if not self.getWorkflowById(wf_id):
                     raise ValueError, (
@@ -450,9 +448,9 @@
 
         """ Set the default chain for this tool
         """
-        default_chain = replace(default_chain, ',', ' ')
+        default_chain = default_chain.replace(',', ' ')
         ids = []
-        for wf_id in split(default_chain, ' '):
+        for wf_id in default_chain.split(' '):
             if wf_id:
                 if not self.getWorkflowById(wf_id):
                     raise ValueError, ( '"%s" is not a workflow ID.' % wf_id)
@@ -470,7 +468,7 @@
             self._chains_by_type = cbt = PersistentMapping()
 
         if type(chain) is type(''):
-            chain = map(strip, split(chain,','))
+            chain = map( lambda x: x.strip(), chain.split(',') )
 
         ti = self._listTypeInfo()
         for t in ti:


=== CMF/CMFCore/__init__.py 1.21 => 1.22 ===
--- CMF/CMFCore/__init__.py:1.21	Wed Dec 11 17:20:36 2002
+++ CMF/CMFCore/__init__.py	Tue Feb  4 17:24:25 2003
@@ -1,14 +1,15 @@
 ##############################################################################
 #
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+# Copyright (c) 2001, 2002 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
-# 
+#
 ##############################################################################
 """ Portal services base objects