mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
add script to find all QT_HAVE_* definitions
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3f2d0117ad
commit
64e29a431b
1 changed files with 21 additions and 0 deletions
21
scripts/gethave.py
Executable file
21
scripts/gethave.py
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import os, re
|
||||||
|
|
||||||
|
cwd = os.path.dirname(__file__)
|
||||||
|
regex = re.compile('(QT_HAVE_[\w]+)')
|
||||||
|
lmatches = []
|
||||||
|
|
||||||
|
for root, subdirs, files in os.walk('%s/../src' % cwd):
|
||||||
|
for sfile in files:
|
||||||
|
if sfile.endswith(('.cpp', '.h')):
|
||||||
|
sfull = '%s/%s' % (root, sfile)
|
||||||
|
with open(sfull, 'rb') as f:
|
||||||
|
scontent = f.read()
|
||||||
|
scontent = scontent.decode('utf-8')
|
||||||
|
for smatch in regex.findall(scontent):
|
||||||
|
smatch = smatch.strip('"\'')
|
||||||
|
if not smatch in lmatches:
|
||||||
|
lmatches.append(smatch)
|
||||||
|
|
||||||
|
print('\n'.join(sorted(lmatches)))
|
Loading…
Add table
Reference in a new issue