OSDN Git Service

drop support for static text [ci reset]
[kde/Katie.git] / scripts / gethave.py
1 #!/usr/bin/python
2
3 import os, re
4
5 cwd = os.path.dirname(__file__)
6 regex = re.compile('(QT_HAVE_[\w]+)')
7 lmatches = []
8
9 for root, subdirs, files in os.walk('%s/../src' % cwd):
10     for sfile in files:
11         if sfile.endswith(('.cpp', '.h')):
12             sfull = '%s/%s' % (root, sfile)
13             with open(sfull, 'rb') as f:
14                 scontent = f.read()
15             scontent = scontent.decode('utf-8')
16             for smatch in regex.findall(scontent):
17                 smatch = smatch.strip('"\'')
18                 if not smatch in lmatches:
19                     lmatches.append(smatch)
20
21 print('\n'.join(sorted(lmatches)))