-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.py
77 lines (31 loc) · 900 Bytes
/
script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import xml.etree.ElementTree as ET
LIST_FUNC = { "navigation_function" , "Detection_contact_function" , "Detection_distance_function"}
tree = ET.parse('TP2bis-res.xml')
root = tree.getroot()
"""
for CFG in root.findall('CFG'):
name = CFG.get('name')
if name in LIST_FUNC:
root = name.findall(".")
print(root)
"""
"""
list_CFG = root.findall("./CFG")
for CFG in list_CFG:
print(CFG.tag, CFG.attrib)
"""
"""
for fun in LIST_FUNC:
path = "./CFG[@name='" + fun + "']"
list_CFG = root.findall(path)
for CFG in list_CFG:
#print(CFG.tag, CFG.attrib)
for i in CFG :
print(i.tag)
"""
for fun in LIST_FUNC:
path = "./CFG[@name='" + fun + "']/ATTRS_LIST/ATTR[@name='WCET']"
l = root.findall(path)
for i in l:
WCET = i.get('value')
print(fun, WCET)