SVN: CMF/branches/2.0/DCWorkflow/ Forward port r69757 from 1.6 to 2.0

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

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

-=-
Modified: CMF/branches/2.0/DCWorkflow/CHANGES.txt
===================================================================
--- CMF/branches/2.0/DCWorkflow/CHANGES.txt	2006-08-24 05:00:14 UTC (rev 69757)
+++ CMF/branches/2.0/DCWorkflow/CHANGES.txt	2006-08-24 05:01:45 UTC (rev 69758)
@@ -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/2.0/DCWorkflow/exportimport.py
===================================================================
--- CMF/branches/2.0/DCWorkflow/exportimport.py	2006-08-24 05:00:14 UTC (rev 69757)
+++ CMF/branches/2.0/DCWorkflow/exportimport.py	2006-08-24 05:01:45 UTC (rev 69758)
@@ -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/branches/2.0/DCWorkflow/tests/test_exportimport.py
===================================================================
--- CMF/branches/2.0/DCWorkflow/tests/test_exportimport.py	2006-08-24 05:00:14 UTC (rev 69757)
+++ CMF/branches/2.0/DCWorkflow/tests/test_exportimport.py	2006-08-24 05:01:45 UTC (rev 69758)
@@ -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.