diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2020-04-08 17:23:04 +0200 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2021-03-26 15:50:36 +0100 |
commit | 5cb6b92f0111d91f68eb268ad025cab783d25f14 (patch) | |
tree | 2a54c35623cda612566c712ef32d0bc36c823fd8 /tests/replace.py | |
parent | 79b9a42514963939b4c2283f9ab1a081d1bc36dc (diff) |
tests: Add compile tests
Only tested by the meson build system.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Diffstat (limited to 'tests/replace.py')
-rwxr-xr-x | tests/replace.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/replace.py b/tests/replace.py new file mode 100755 index 0000000..8a8a18e --- /dev/null +++ b/tests/replace.py @@ -0,0 +1,23 @@ +#!/usr/bin/python3 + +import sys + +execpath, inpath, outpath, *dict_list = sys.argv + +dictonary = {} +while dict_list: + key, value, *rest = dict_list + dictonary[key] = value + dict_list = rest + +infile = open(inpath, 'r') +outfile = open(outpath, 'w') + +buf = infile.read() +infile.close() + +for key, value in dictonary.items(): + buf = buf.replace('@{}@'.format(key), value) + +outfile.write(buf) +outfile.close() |