From 520130abbec7ef21c21373629eeff3807d981b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pigeon?= Date: Wed, 15 Oct 2014 15:37:54 +0200 Subject: [PATCH] [FIX] remove usage of minidom, use pretty print feature from lxml --- help_online/models/export_help_wizard.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/help_online/models/export_help_wizard.py b/help_online/models/export_help_wizard.py index 61530278..53883aee 100644 --- a/help_online/models/export_help_wizard.py +++ b/help_online/models/export_help_wizard.py @@ -24,7 +24,6 @@ import time import copy from lxml import etree as ET -from xml.dom import minidom as minidom from openerp import models, fields, api, exceptions from openerp.tools.translate import _ @@ -220,10 +219,9 @@ class ExportHelpWizard(models.TransientModel): data_node.append(snippet) if len(view_data_list) > 0: - rough_string = ET.tostring(xml_to_export, encoding='utf-8', - xml_declaration=True) - reparsed = minidom.parseString(rough_string) - return reparsed.toprettyxml(indent=" ", encoding='utf-8') + return ET.tostring(xml_to_export, encoding='utf-8', + xml_declaration=True, + pretty_print=True) else: return False