[Erp5-report] r44298 nicolas - /erp5/trunk/products/Formulator/Widget.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Mar 15 14:37:29 CET 2011
Author: nicolas
Date: Tue Mar 15 14:37:28 2011
New Revision: 44298
URL: http://svn.erp5.org?rev=44298&view=rev
Log:
remove text:formula attributes which keep nodes to be updated
add style URI to have shorter xml output
Modified:
erp5/trunk/products/Formulator/Widget.py
Modified: erp5/trunk/products/Formulator/Widget.py
URL: http://svn.erp5.org/erp5/trunk/products/Formulator/Widget.py?rev=44298&r1=44297&r2=44298&view=diff
==============================================================================
--- erp5/trunk/products/Formulator/Widget.py [utf8] (original)
+++ erp5/trunk/products/Formulator/Widget.py [utf8] Tue Mar 15 14:37:28 2011
@@ -16,12 +16,14 @@ DRAW_URI = 'urn:oasis:names:tc:opendocum
TEXT_URI = 'urn:oasis:names:tc:opendocument:xmlns:text:1.0'
FORM_URI = 'urn:oasis:names:tc:opendocument:xmlns:form:1.0'
OFFICE_URI = 'urn:oasis:names:tc:opendocument:xmlns:office:1.0'
+STYLE_URI = 'urn:oasis:names:tc:opendocument:xmlns:style:1.0'
NSMAP = {
'draw': DRAW_URI,
'text': TEXT_URI,
'form': FORM_URI,
'office': OFFICE_URI,
+ 'style': STYLE_URI,
}
EForm = ElementMaker(namespace=FORM_URI, nsmap=NSMAP)
@@ -1752,6 +1754,9 @@ class IntegerWidget(TextWidget) :
text_node = Element('{%s}%s' % (TEXT_URI, local_name), nsmap=NSMAP)
text_node.text = str(value)
attr_dict['{%s}value' % OFFICE_URI] = str(value)
+ formula_attribute_name = '{%s}formula' % TEXT_URI
+ if formula_attribute_name in attr_dict:
+ del attr_dict[formula_attribute_name]
text_node.attrib.update(attr_dict)
if as_string:
return etree.tostring(text_node)
More information about the Erp5-report
mailing list