[CMF-checkins] SVN: CMF/branches/1.6/DCWorkflow/ Fix nasty errors
on import of transitions that include variable Expressions
Alec Mitchell
apm13 at columbia.edu
Thu Aug 24 01:00:15 EDT 2006
Log message for revision 69757:
Fix nasty errors on import of transitions that include variable Expressions
Changed:
U CMF/branches/1.6/DCWorkflow/CHANGES.txt
U CMF/branches/1.6/DCWorkflow/exportimport.py
U CMF/branches/1.6/DCWorkflow/tests/test_exportimport.py
-=-
Modified: CMF/branches/1.6/DCWorkflow/CHANGES.txt
===================================================================
--- CMF/branches/1.6/DCWorkflow/CHANGES.txt 2006-08-24 04:31:52 UTC (rev 69756)
+++ CMF/branches/1.6/DCWorkflow/CHANGES.txt 2006-08-24 05:00:14 UTC (rev 69757)
@@ -1,6 +1,10 @@
Next release
+- Fixed errors and site breakage on GenericSetup import of transitions
+with variable expressions set. They were previously being imported as
+text rather tha Expressions.
+
- Added support for groups. Although the implementation is currently
tied to a particular implementation of groups, it should be
easy to generalize to any product that adds groups to Zope.
Modified: CMF/branches/1.6/DCWorkflow/exportimport.py
===================================================================
--- CMF/branches/1.6/DCWorkflow/exportimport.py 2006-08-24 04:31:52 UTC (rev 69756)
+++ CMF/branches/1.6/DCWorkflow/exportimport.py 2006-08-24 05:00:14 UTC (rev 69757)
@@ -18,6 +18,7 @@
import re
from xml.dom.minidom import parseString
+from Expression import Expression
from AccessControl import ClassSecurityInfo
from Acquisition import Implicit
from Globals import InitializeClass
@@ -1071,9 +1072,10 @@
, actbox_category = action[ 'category' ]
, props = props
)
+ var_mapping = [(name, Expression(text)) for name, text in
+ t_info[ 'variables' ].items()]
+ t.var_exprs = PersistentMapping(var_mapping)
- t.var_exprs = PersistentMapping( t_info[ 'variables' ].items() )
-
def _initDCWorkflowWorklists( workflow, worklists ):
""" Initialize DCWorkflow worklists
Modified: CMF/branches/1.6/DCWorkflow/tests/test_exportimport.py
===================================================================
--- CMF/branches/1.6/DCWorkflow/tests/test_exportimport.py 2006-08-24 04:31:52 UTC (rev 69756)
+++ CMF/branches/1.6/DCWorkflow/tests/test_exportimport.py 2006-08-24 05:00:14 UTC (rev 69757)
@@ -2278,7 +2278,7 @@
self.assertEqual( len( var_exprs ), len( expected[ 9 ] ) )
for var_id, expr in var_exprs.items():
- self.assertEqual( expr, expected[ 9 ][ var_id ] )
+ self.assertEqual( expr.text, expected[ 9 ][ var_id ] )
guard = transition.getGuard()
More information about the CMF-checkins
mailing list