config_tools: change generic folder to generic_board folder in config app

change generic folder to generic_board folder in config app according
to the reorg data folders and update the method to save xmls.

Tracked-On: #5723

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
This commit is contained in:
Shuang Zheng
2021-02-08 21:26:01 +08:00
committed by wenlingz
parent 30784ad6f1
commit ca5ff7eba6
3 changed files with 14 additions and 16 deletions

View File

@@ -95,7 +95,8 @@ class XmlConfig:
if self._default \
else os.path.join(self._xml_path, 'user_defined', self._curr_xml + '.xml')
tree = etree.parse(xml_path)
parser = etree.XMLParser(remove_blank_text=True)
tree = etree.parse(xml_path, parser)
self._curr_xml_tree = tree
except ValueError:
print('xml parse error: {}'.format(xml))
@@ -330,9 +331,7 @@ class XmlConfig:
if not os.path.isdir(xml_path):
os.makedirs(xml_path)
self._format_xml(self._curr_xml_tree.getroot())
self._curr_xml_tree.write(os.path.join(xml_path, xml+'.xml'), encoding='utf-8',
xml_declaration=True, method='xml')
self._curr_xml_tree.write(os.path.join(xml_path, xml+'.xml'), encoding='utf-8', pretty_print=True)
def _format_xml(self, element, depth=0):
i = "\n" + depth * " "