WebUI: use native event listeners for keyboard events
[qBittorrent.git] / dist / windows / gather_qt_translations.py
blobcfa212c8cea0e1b1461f8cfe5be48d5e8084f7ff
1 #!/usr/bin/env python3
3 import argparse
4 import glob
5 import os
6 import shutil
7 import sys
8 from typing import List
11 def isNotStub(path: str) -> bool:
12 return (os.path.getsize(path) >= (10 * 1024))
15 def main() -> int:
16 parser = argparse.ArgumentParser(description='Gather valid Qt translations for NSIS packaging.')
17 parser.add_argument("qt_translations_folder", help="Qt's translations folder")
18 parser.add_argument("nsis_packaging_folder", help="NSIS packaging translations folder")
19 args = parser.parse_args()
21 tmp_translations: List[str] = glob.glob(f'{args.qt_translations_folder}/qt_??.qm')
22 tmp_translations += glob.glob(f'{args.qt_translations_folder}/qt_??_??.qm')
23 tmp_translations += glob.glob(f'{args.qt_translations_folder}/qtbase_??.qm')
24 tmp_translations += glob.glob(f'{args.qt_translations_folder}/qtbase_??_??.qm')
26 filtered = filter(isNotStub, tmp_translations)
27 for file in filtered:
28 shutil.copy2(file, args.nsis_packaging_folder)
30 return 0
33 if __name__ == '__main__':
34 sys.exit(main())