2022-02-24 01:29:13 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import random
|
|
|
|
|
|
|
|
configfile = "src/core/global/qconfig.h.cmake"
|
|
|
|
|
|
|
|
with open(configfile, 'r') as f:
|
|
|
|
configcontent = f.read()
|
|
|
|
|
|
|
|
isconfig = False
|
|
|
|
configlines = []
|
|
|
|
for sline in configcontent.splitlines():
|
|
|
|
if sline == '// Misc':
|
|
|
|
isconfig = True
|
|
|
|
continue
|
|
|
|
elif isconfig and not sline:
|
|
|
|
isconfig = False
|
|
|
|
if isconfig:
|
|
|
|
configlines.append(sline)
|
|
|
|
|
|
|
|
toreplace = configlines[random.randrange(0, len(configlines))]
|
|
|
|
replacement = toreplace.replace('#cmakedefine', '#define')
|
2022-02-24 05:21:50 +02:00
|
|
|
configdefinition = replacement.replace('#define ', '')
|
|
|
|
print('defining %s' % configdefinition)
|
2022-02-24 01:29:13 +02:00
|
|
|
configcontent = configcontent.replace(toreplace, replacement)
|
|
|
|
|
|
|
|
with open(configfile, 'w') as f:
|
|
|
|
f.write(configcontent)
|
|
|
|
|