xref: /aosp_15_r20/external/wayland-protocols/freedesktop.org/tests/replace.py (revision 6c119a463dd5c45dd05bbe67429293292dde15ee)
1#!/usr/bin/env python3
2
3import sys
4
5execpath, inpath, outpath, *dict_list = sys.argv
6
7dictonary = {}
8while dict_list:
9    key, value, *rest = dict_list
10    dictonary[key] = value
11    dict_list = rest
12
13infile = open(inpath, 'r')
14outfile = open(outpath, 'w')
15
16buf = infile.read()
17infile.close()
18
19for key, value in dictonary.items():
20    buf = buf.replace('@{}@'.format(key), value)
21
22outfile.write(buf)
23outfile.close()
24