beepo/tests/gtkw_filters/arg_types.py

33 lines
539 B
Python
Executable File

#!/usr/bin/env python3
import sys
arg_types = {
"0": "R",
"1": "O",
"2": "P",
"3": "B",
"4": "H",
"5": "W",
"6": "D",
"7": "A",
"8": "N"
}
def main():
fh_in = sys.stdin
fh_out = sys.stdout
while True:
# incoming values have newline
l = fh_in.readline()
if not l:
return 0
for arg_id in arg_types:
l = l.replace(arg_id, arg_types[arg_id])
fh_out.write(l)
fh_out.flush()
if __name__ == '__main__':
sys.exit(main())