forked from xmikos/qspectrumanalyzer
-
Notifications
You must be signed in to change notification settings - Fork 10
/
setup-qt.py
executable file
·26 lines (20 loc) · 920 Bytes
/
setup-qt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
import os, shutil
from glob import glob
package = "qspectrumanalyzer"
languages = ["cs"]
print("Rebuilding PyQt resource files...")
for f in glob("{}/*.qrc".format(package)):
os.system("pyrcc4 -o {}/qrc_{}.py {}".format(package, os.path.basename(f[:-4]), f))
print("Rebuilding PyQt UI files...")
for f in glob("{}/*.ui".format(package)):
os.system("pyuic4 -o {}/ui_{}.py {}".format(package, os.path.basename(f[:-3]), f))
print("Updating translations...")
lang_files = " ".join("{}/languages/{}_{}.ts".format(package, package, lang) for lang in languages)
os.system("pylupdate4 {}/*.py -ts {}".format(package, lang_files))
os.system("lrelease {}/languages/*.ts".format(package))
print("Regenerating .pyc files...")
shutil.rmtree("{}/__pycache__".format(package), ignore_errors=True)
for f in glob("{}/*.pyc".format(package)):
os.remove(f)
__import__("{}.__main__".format(package))