Mercurial > hg > orthanc-databases
annotate Resources/PostgreSQL/PrepareCMakeConfigurationFile.py @ 28:c0cb5d2cd696
checks depending on Orthanc version
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 16 Jul 2018 14:48:43 +0200 |
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 |