mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
make getenv script Python 3 compatible
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
666a24802f
commit
3d930c875a
1 changed files with 8 additions and 6 deletions
|
@ -10,10 +10,12 @@ for root, subdirs, files in os.walk('%s/../src' % cwd):
|
||||||
for sfile in files:
|
for sfile in files:
|
||||||
if sfile.endswith(('.cpp', '.h')):
|
if sfile.endswith(('.cpp', '.h')):
|
||||||
sfull = '%s/%s' % (root, sfile)
|
sfull = '%s/%s' % (root, sfile)
|
||||||
with open(sfull, 'r') as f:
|
with open(sfull, 'rb') as f:
|
||||||
for smatch in regex.findall(f.read()):
|
scontent = f.read()
|
||||||
smatch = smatch.strip('"\'')
|
scontent = scontent.decode('utf-8')
|
||||||
if not smatch in lmatches:
|
for smatch in regex.findall(scontent):
|
||||||
lmatches.append(smatch)
|
smatch = smatch.strip('"\'')
|
||||||
|
if not smatch in lmatches:
|
||||||
|
lmatches.append(smatch)
|
||||||
|
|
||||||
print('\n'.join(sorted(lmatches)))
|
print('\n'.join(sorted(lmatches)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue