Mercurial > hg > orthanc-databases
annotate Resources/PostgreSQL/PrepareCMakeConfigurationFile.py @ 366:cd9521e04249 attach-custom-data
DatabaseBackendAdapterV4: added support for customData + revision when not already done
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 15 Sep 2022 18:12:34 +0200 |
parents | 8c7bb94adff7 |
children |
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 | |
172
8c7bb94adff7
trying upgrade from libpq 9.6.1 to 13.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
9 r = re.compile(r'^#undef ([a-zA-Z0-9_]+)$') |
0 | 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 |