ConfigTreeNode.py
branchpython3
changeset 3755 ca814b175391
parent 3752 9f6f46dbe3ae
child 3785 29bc2bebf1d4
equal deleted inserted replaced
3754:98a76dbb1b6d 3755:ca814b175391
   208                 # Create it
   208                 # Create it
   209                 os.mkdir(ctnpath)
   209                 os.mkdir(ctnpath)
   210 
   210 
   211             # generate XML for base XML parameters controller of the confnode
   211             # generate XML for base XML parameters controller of the confnode
   212             if self.MandatoryParams:
   212             if self.MandatoryParams:
   213                 BaseXMLFile = open(self.ConfNodeBaseXmlFilePath(), 'w')
   213                 BaseXMLFile = open(self.ConfNodeBaseXmlFilePath(), 'w', encoding='utf-8')
   214                 BaseXMLFile.write(etree.tostring(
   214                 BaseXMLFile.write(etree.tostring(
   215                     self.MandatoryParams[1],
   215                     self.MandatoryParams[1],
   216                     pretty_print=True,
   216                     pretty_print=True,
   217                     xml_declaration=True,
   217                     xml_declaration=True,
   218                     encoding='utf-8'))
   218                     encoding='utf-8').decode())
   219                 BaseXMLFile.close()
   219                 BaseXMLFile.close()
   220 
   220 
   221             # generate XML for XML parameters controller of the confnode
   221             # generate XML for XML parameters controller of the confnode
   222             if self.CTNParams:
   222             if self.CTNParams:
   223                 XMLFile = open(self.ConfNodeXmlFilePath(), 'w')
   223                 XMLFile = open(self.ConfNodeXmlFilePath(), 'w', encoding='utf-8')
   224                 XMLFile.write(etree.tostring(
   224                 XMLFile.write(etree.tostring(
   225                     self.CTNParams[1],
   225                     self.CTNParams[1],
   226                     pretty_print=True,
   226                     pretty_print=True,
   227                     xml_declaration=True,
   227                     xml_declaration=True,
   228                     encoding='utf-8'))
   228                     encoding='utf-8').decode())
   229                 XMLFile.close()
   229                 XMLFile.close()
   230 
   230 
   231             # Call the confnode specific OnCTNSave method
   231             # Call the confnode specific OnCTNSave method
   232             result = self.OnCTNSave(from_project_path)
   232             result = self.OnCTNSave(from_project_path)
   233             if not result:
   233             if not result: