[Zope-CMF] Re: Function Removal if Item is locked.

Yuppie schubbe@web.de
Tue, 11 Mar 2003 17:25:39 +0100


This is a multi-part message in MIME format.
--------------030905080702060903050905
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi Tres!


Tres Seaver wrote:
> I am going to land this on a new branch against today's head, if anybody
> would like to help test:
> 
>   $ cvs -q up -AdP  # get to the head;  make sure no local edits!
>   $ cvs -q up -r tseaver-ti_apb_redux-branch  # use the branch

Looks great!


> Anyone game to play?  I have build and lightly tested a new CMFSite with
> this code, but am certain that sites built previously die horribly. 
> Perhaps somebody can come up with a patch which avoids the necessity of
> running a conversion script?

Well. _convertActions needs some cleanup, but you were almost done.

I attached a quick'n'dirty patch. At least my old CMFSite didn't die.



BTW: Two minor issues


1.) I guess this change (and resulting changes) was not intended:

--- CMF/CMFCore/tests/test_TypesTool.py:1.18	Mon Jan  6 15:41:10 2003
+++ CMF/CMFCore/tests/test_TypesTool.py	Mon Mar 10 18:49:55 2003
@@ -1,5 +1,4 @@
-from unittest import TestCase, TestSuite, makeSuite, main
-
+import unittest


2.) I recently changed explainActionsTool.dtml and 
manageActionProviders.dtml. They have to be updated now.



Cheers,

Yuppie

--------------030905080702060903050905
Content-Type: text/plain;
 name="ti.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ti.patch"

Index: CMFCore/TypesTool.py
===================================================================
RCS file: /cvs-repository/CMF/CMFCore/TypesTool.py,v
retrieving revision 1.49.2.1
diff -u -r1.49.2.1 TypesTool.py
--- CMFCore/TypesTool.py	10 Mar 2003 23:49:53 -0000	1.49.2.1
+++ CMFCore/TypesTool.py	11 Mar 2003 16:06:47 -0000
@@ -254,6 +254,11 @@
         else:
             return default
 
+    def listActions( self, info=None ):
+        if type( self._actions[0] ) == type( {} ):
+            self._convertActions()
+        return self._actions or ()
+
     security.declarePrivate( '_convertActions' )
     def _convertActions( self ):
         """
@@ -272,7 +277,7 @@
 
                 self.addAction( id=action['id']
                             , name=action['name']
-                            , action=action.get( 'action' )
+                            , action='string:%s' % action.get( 'action' )
                             , condition=action.get( 'condition' )
                             , permission=action.get('permissions', () )
                             , category=action.get( 'category', 'object' )

--------------030905080702060903050905--