-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtransform.py
More file actions
37 lines (33 loc) · 1.24 KB
/
Copy pathtransform.py
File metadata and controls
37 lines (33 loc) · 1.24 KB
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
f = open("Start_Tr_Tx.xml", 'r')
f2 = open("Start_Tr_Tx2.xml", 'w')
for line in f:
# line = '<bpmndi:BPMNShape id="StartEvent_0q98cyn_di" bpmnElement="StartEvent_Tx_RV-ST">'
if line.find('<bpmndi:BPMNShape id="') != -1 & line.find('isMarkerVisible') == -1:
line2 = ' <bpmndi:BPMNShape id="'
x = line.split('=')
y = x[2][:-2]
param, value = y.split('"', 1)
value = value[:-1]
line2 = line2 + value + '_di' + '"'
param, value = line.split('"', 1)
param, value = value.split('"', 1)
line2 = line2 + value
# print(line2)
f2.write(line2)
# <bpmndi:BPMNEdge id="SequenceFlow_0jxoz50_di" bpmnElement="SequenceFlow_B_23_Tx">
elif line.find('<bpmndi:BPMNEdge id="') != -1 & line.find('isMarkerVisible') == -1:
line2 = ' <bpmndi:BPMNEdge id="'
x = line.split('=')
y = x[2][:-2]
param, value = y.split('"', 1)
value = value[:-1]
line2 = line2 + value + '_di' + '"'
param, value = line.split('"', 1)
param, value = value.split('"', 1)
line2 = line2 + value
# print(line2)
f2.write(line2)
else:
f2.write(line)
f.close()
f2.close()