Mercurial > hg > orthanc-databases
annotate Resources/PostgreSQL/PrepareCMakeConfigurationFile.py @ 111:1525539ce5d9
fix clang warnings
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 23 Jan 2019 17:27:13 +0100 |
parents | 7cea966b6829 |
children | 8c7bb94adff7 |
rev | line source |
---|---|
0 | 1 #!/usr/bin/python |
2 | |
3 import re | |
4 import sys | |
5 | |
6 if len(sys.argv) != 3: | |
7 raise Exception('Bad number of arguments') | |
8 | |
9 r = re.compile(r'^#undef ([A-Z0-9_]+)$') | |
10 | |
11 with open(sys.argv[1], 'r') as f: | |
12 with open(sys.argv[2], 'w') as g: | |
13 for l in f.readlines(): | |
14 m = r.match(l) | |
15 if m != None: | |
16 s = m.group(1) | |
17 g.write('#cmakedefine %s @%s@\n' % (s, s)) | |
18 else: | |
19 g.write(l) | |
20 |