8 from typing
import List
11 def isNotStub(path
: str) -> bool:
12 return (os
.path
.getsize(path
) >= (10 * 1024))
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
)
28 shutil
.copy2(file, args
.nsis_packaging_folder
)
33 if __name__
== '__main__':