Commit f8d826d4 authored by Jérome Perrin's avatar Jérome Perrin

core: use pprint.pformat to pretty print activity message_list

using json in 37b795fb was wrong,
because not all arguments can be converted to json (for example
DateTime instances)

This also enable the format using pprint.pformat for args, instead
of a simple str that was done in ActivityTool_getMessageList.
parent a3ea5e07
...@@ -13,7 +13,6 @@ for message in message_list: ...@@ -13,7 +13,6 @@ for message in message_list:
message.edit( message.edit(
str_object_path = '/'.join(message.object_path), str_object_path = '/'.join(message.object_path),
uid_activity = str(message.uid) + ' ('+ message.activity[3:] +')', uid_activity = str(message.uid) + ' ('+ message.activity[3:] +')',
arguments = str(message.args),
delete = '[Delete]', delete = '[Delete]',
restart = '[Restart]', restart = '[Restart]',
) )
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<string>listbox_call_traceback</string> <string>listbox_call_traceback</string>
<string>listbox_activity_kw</string> <string>listbox_activity_kw</string>
<string>listbox_kw</string> <string>listbox_kw</string>
<string>listbox_arguments</string> <string>listbox_args</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<string>Activity Kw</string> <string>Activity Kw</string>
</tuple> </tuple>
<tuple> <tuple>
<string>arguments</string> <string>args</string>
<string>Arguments</string> <string>Arguments</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
<string></string> <string></string>
</tuple> </tuple>
<tuple> <tuple>
<string>arguments</string> <string>args</string>
<string></string> <string></string>
</tuple> </tuple>
<tuple> <tuple>
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: modules[\'json\'].dumps(cell.activity_kw, indent=True)</string> </value> <value> <string>python: modules[\'pprint\'].pformat(cell.activity_kw)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -11,13 +11,14 @@ ...@@ -11,13 +11,14 @@
<value> <value>
<list> <list>
<string>css_class</string> <string>css_class</string>
<string>default</string>
<string>title</string> <string>title</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>listbox_arguments</string> </value> <value> <string>listbox_args</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -53,6 +54,16 @@ ...@@ -53,6 +54,16 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -65,6 +76,10 @@ ...@@ -65,6 +76,10 @@
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -76,6 +91,10 @@ ...@@ -76,6 +91,10 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>pre</string> </value> <value> <string>pre</string> </value>
</item> </item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_text_area_field</string> </value> <value> <string>my_text_area_field</string> </value>
...@@ -98,4 +117,17 @@ ...@@ -98,4 +117,17 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: modules[\'pprint\'].pformat(cell.args)</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: modules[\'json\'].dumps(cell.kw, indent=True)</string> </value> <value> <string>python: modules[\'pprint\'].pformat(cell.kw)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment