-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprepare.py
More file actions
33 lines (26 loc) · 1023 Bytes
/
prepare.py
File metadata and controls
33 lines (26 loc) · 1023 Bytes
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
import sys
def apply_rules(s):
s = s.replace('!FEATURE!', 'style="filled"; fillcolor="lightyellow3";')
node='shape=ellipse, style=filled, '
s = s.replace('!NODE:missing!', node + 'fillcolor=red')
s = s.replace('!NODE:development!', node + 'fillcolor=pink')
s = s.replace('!NODE:designed!', node + 'fillcolor=orange')
s = s.replace('!NODE:compiled!', node + 'fillcolor=yellow')
s = s.replace('!NODE:documented!', node + 'fillcolor=green')
s = s.replace('!NODE:tested!', node + 'fillcolor=lightblue')
s = s.replace('!CONFIG!', 'shape=note, style=filled, fillcolor=grey')
s = s.replace('!TOPIC!', 'shape=box, style=filled, fillcolor=pink')
warn = \
"""
// DO NOT EDIT THIS FILE. IT IS NOW AUTOGENERATED FROM Duckietown_ROS_Diagram.dot.in
//
//
// Any changes that you do will be erased.
//
//
"""
return warn + s
if __name__ == '__main__':
s = sys.stdin.read()
s = apply_rules(s)
print(s)