Commit 66eddf10 authored by Boris Kocherov's avatar Boris Kocherov

fix OOo use xml_marshaller.xml_marshaller instead of xml.marshal.generic

parent be816eed
...@@ -430,10 +430,8 @@ class OOoChartWidget(Widget.Widget): ...@@ -430,10 +430,8 @@ class OOoChartWidget(Widget.Widget):
REQUEST.set('render_prefix', render_prefix) REQUEST.set('render_prefix', render_prefix)
#needed to update REQUEST #needed to update REQUEST
argument_dict = self.getArgumentDict(field, REQUEST) argument_dict = self.getArgumentDict(field, REQUEST)
from xml.marshal.generic import dumps from xml_marshaller.xml_marshaller import dumps
dump_args = dumps(argument_dict) dump_args = dumps(argument_dict)
#remove xml declaration (first processing node)
dump_args = dump_args[dump_args.index('?>')+2:]
content = '''<office:include path="%s/ERP5Site_buildChart" content = '''<office:include path="%s/ERP5Site_buildChart"
xlink:type="simple" xlink:actuate="onLoad" xlink:type="simple" xlink:actuate="onLoad"
xlink:show="embed">%s</office:include> xlink:show="embed">%s</office:include>
......
...@@ -424,7 +424,7 @@ class OOoTemplate(ZopePageTemplate): ...@@ -424,7 +424,7 @@ class OOoTemplate(ZopePageTemplate):
for office_include in xml_doc.xpath('//office:include', namespaces=xml_doc.nsmap): for office_include in xml_doc.xpath('//office:include', namespaces=xml_doc.nsmap):
marshal_list = office_include.xpath('./marshal') marshal_list = office_include.xpath('./marshal')
if marshal_list: if marshal_list:
from xml.marshal.generic import loads from xml_marshaller.xml_marshaller import loads
arg_dict = loads(etree.tostring(marshal_list[0], encoding='utf-8', arg_dict = loads(etree.tostring(marshal_list[0], encoding='utf-8',
xml_declaration=True, pretty_print=False)) xml_declaration=True, pretty_print=False))
extra_context.update(arg_dict) extra_context.update(arg_dict)
......
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