[CMF-checkins] CVS: CMF/CMFCore - TypesTool.py:1.49.2.2
Tres Seaver
tseaver@zope.com
Tue, 11 Mar 2003 18:43:59 -0500
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv21927/CMFCore
Modified Files:
Tag: tseaver-ti_apb_redux-branch
TypesTool.py
Log Message:
- CMFCore/TypesTool.py:
o Force 'string:' prefix for "action" TALES expression when converting
actions from dictionaries.
- CMFCore/tests/test_TypesTool.py:
o Add explicit test of conversion from dictionary-based actions.
o Normalize wide lines.
=== CMF/CMFCore/TypesTool.py 1.49.2.1 => 1.49.2.2 ===
--- CMF/CMFCore/TypesTool.py:1.49.2.1 Mon Mar 10 18:49:53 2003
+++ CMF/CMFCore/TypesTool.py Tue Mar 11 18:43:15 2003
@@ -232,6 +232,16 @@
"""
return self.global_allow
+ security.declarePublic('listActions')
+ def listActions( self, info=None ):
+
+ """ Return a sequence of the action info objects for this type.
+ """
+ if self._actions and type( self._actions[0] ) == type( {} ):
+ self._convertActions()
+
+ return self._actions or ()
+
security.declarePublic('getActionById')
def getActionById( self, id, default=_marker ):
"""
@@ -272,7 +282,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' )