Mercurial > hg > orthanc-databases
view Resources/PostgreSQL/PrepareCMakeConfigurationFile.py @ 594:14ba6a6f633f find-refactoring tip
ChildrenIndex2 creation now compatible with PG 9
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Fri, 15 Nov 2024 11:11:05 +0100 |
parents | 8c7bb94adff7 |
children |
line wrap: on
line source
#!/usr/bin/python import re import sys if len(sys.argv) != 3: raise Exception('Bad number of arguments') r = re.compile(r'^#undef ([a-zA-Z0-9_]+)$') with open(sys.argv[1], 'r') as f: with open(sys.argv[2], 'w') as g: for l in f.readlines(): m = r.match(l) if m != None: s = m.group(1) g.write('#cmakedefine %s @%s@\n' % (s, s)) else: g.write(l)