Debian Codegraph @

test cases/common/100 postconf with args/postconf.py

raw
1 #!/usr/bin/env python3
2
3 import sys, os
4
5 template = '''#pragma once
6
7 #define THE_NUMBER {}
8 #define THE_ARG1 {}
9 #define THE_ARG2 {}
10 '''
11
12 input_file = os.path.join(os.environ['MESON_SOURCE_ROOT'], 'raw.dat')
13 output_file = os.path.join(os.environ['MESON_BUILD_ROOT'], 'generated.h')
14
15 with open(input_file, encoding='utf-8') as f:
16 data = f.readline().strip()
17 with open(output_file, 'w', encoding='utf-8') as f:
18 f.write(template.format(data, sys.argv[1], sys.argv[2]))