SVN: CMF/trunk/DCWorkflow/ Forward port r69757 from 1.6 branch to trunk

Alec Mitchell <[email protected]>
Newsgroups gmane.comp.web.zope.cmf.cvs
Message-ID <[email protected]>
Log message for revision 69759:
  Forward port r69757 from 1.6 branch to trunk
  

Changed:
  U   CMF/trunk/DCWorkflow/CHANGES.txt
  U   CMF/trunk/DCWorkflow/exportimport.py
  U   CMF/trunk/DCWorkflow/tests/test_exportimport.py

-=-
Modified: CMF/trunk/DCWorkflow/CHANGES.txt
===================================================================
--- CMF/trunk/DCWorkflow/CHANGES.txt	2006-08-24 05:01:45 UTC (rev 69758)
+++ CMF/trunk/DCWorkflow/CHANGES.txt	2006-08-24 05:03:23 UTC (rev 69759)
@@ -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/trunk/DCWorkflow/exportimport.py
===================================================================
--- CMF/trunk/DCWorkflow/exportimport.py	2006-08-24 05:01:45 UTC (rev 69758)
+++ CMF/trunk/DCWorkflow/exportimport.py	2006-08-24 05:03:23 UTC (rev 69759)
@@ -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
@@ -1075,9 +1076,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/trunk/DCWorkflow/tests/test_exportimport.py
===================================================================
--- CMF/trunk/DCWorkflow/tests/test_exportimport.py	2006-08-24 05:01:45 UTC (rev 69758)
+++ CMF/trunk/DCWorkflow/tests/test_exportimport.py	2006-08-24 05:03:23 UTC (rev 69759)
@@ -2270,7 +2270,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()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.