X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FxmlManager.py;h=4b4fa61cfc08152cc98c29eb82b9f17756859910;hb=606f9b6618e0e0659d4029c607eaa04d9b3501cc;hp=c4a0f6f8e2a901952864143ffef26fcfa742d313;hpb=4090372e27f86919964c6a73d566fed80dd709c1;p=tools%2Fsat.git diff --git a/src/xmlManager.py b/src/xmlManager.py index c4a0f6f..4b4fa61 100644 --- a/src/xmlManager.py +++ b/src/xmlManager.py @@ -27,7 +27,7 @@ except: pass import src -from . import ElementTree as etree +import src.ElementTree as etree verbose = False @@ -56,14 +56,15 @@ class XmlLogFile(object): ''' log_file_path = self.logFile if file_path: - log_file_path = file_path + log_file_path = file_path try: - f = open(log_file_path, 'w') + with open(log_file_path, 'w') as f: f.write("\n") if stylesheet: f.write("\n" % stylesheet) - f.write(etree.tostring(self.xmlroot, encoding='utf-8')) - f.close() + pass + res= etree.tostring(self.xmlroot, encoding='utf-8') + f.write(res) except IOError: pass @@ -215,7 +216,9 @@ def write_report(filename, xmlroot, stylesheet): f.write("\n") if styleName is not None: f.write("\n" % styleName) - f.write(etree.tostring(xmlroot, encoding='utf-8')) + res = etree.tostring(xmlroot, encoding='utf-8') + # print("********** etree.tostring %s" % res) + f.write(res) # create fileStyle in dirname if not existing if styleName is not None: