Reformat symbolify.py

This commit is contained in:
Vaidas Gasiunas 2023-03-03 14:00:59 +01:00
parent 3d9f37d1d1
commit e95ff58b95
1 changed files with 8 additions and 7 deletions

View File

@ -1,14 +1,15 @@
if __name__ == '__main__':
if __name__ == "__main__":
import re
import sys
r = re.compile('DLLEXPORT[^(]*(fdb_[^(]*)[(]')
r = re.compile("DLLEXPORT[^(]*(fdb_[^(]*)[(]")
header_files = sys.argv[1:-1]
symbols_file = sys.argv[-1]
symbols = set()
for header_file in header_files:
with open(header_file, 'r') as f:
symbols.update('_' + m.group(1) for m in r.finditer(f.read()))
with open(header_file, "r") as f:
symbols.update("_" + m.group(1) for m in r.finditer(f.read()))
symbols = sorted(symbols)
with open(symbols_file, 'w') as f:
f.write('\n'.join(symbols))
f.write('\n')
with open(symbols_file, "w") as f:
f.write("\n".join(symbols))
f.write("\n")