Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###############################################
- ### Module : XML_ANIM.PY
- ### Author : Jens Dittmann TES
- ### Description : substitutes anim ids by symbol names
- ### The anim ids are taken from an XML performance report
- ### ids within tag <WPA> -> use WRS_VisualResourceIDs.hpp as transformation table
- ### ids within tag <ViewChange> -> use WRS_ACEResourceIDs.hpp as transformation table
- ###############################################
- import re
- import xml_configure as config
- import xml_files as files
- import enum2array
- path2BrutusGen = "../../../pkg/art47/tool/brutus/out/"
- all_widgets = enum2array.make_enumarray("enum WidgetIDs.*", "Widget_FPK", path2BrutusGen + "WRS_VisualResourceIDs.hpp")
- all_animations = enum2array.make_enumarray("enum AnimationIDs.*", "Animation_", path2BrutusGen + "WRS_ACEResourceIDs.hpp")
- etree = config.import_lxml()
- tree = etree.parse("../test_report.xml")
- root = tree.getroot()
- # print(root.tag)
- re_wpa = re.compile("WPA")
- re_view_change = re.compile("ViewChange")
- # children = list(root)
- csubstitute = files.substitutor()
- for test_case in root:
- print(test_case[0].tag)
- for test_case_item in test_case:
- if(re_wpa.match(test_case_item.tag)):
- test_case_item.text = csubstitute.ani_ids(all_widgets, test_case_item.text)
- if (re_view_change.match(test_case_item.tag)):
- test_case_item.text = csubstitute.ani_ids(all_animations, test_case_item.text)
- # print all requirement in the measurement for this trigger
- if(csubstitute.counter > 0):
- files.xml2file(etree, root, xlsHeader="../test_report.xml")
- print("END")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement