-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuic_rcc.py
More file actions
34 lines (27 loc) · 833 Bytes
/
uic_rcc.py
File metadata and controls
34 lines (27 loc) · 833 Bytes
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
27
28
29
30
31
32
33
34
import os
import subprocess
pyside6_dir = r"C:\Program Files\CloudCompare\plugins\Python\Lib\site-packages\PySide6"
uic = os.path.join(pyside6_dir, "uic.exe")
rcc = os.path.join(pyside6_dir, "rcc.exe")
cmd = [uic,
"./qt/main_window.ui",
"-g",
"python",
"-o",
"./src/cloudcompare_python_plugin/main_window_ui.py"
]
subprocess.run(cmd)
cmd = [rcc,
"./qt/resource_collection.qrc",
"-g",
"python",
"-o",
"./src/cloudcompare_python_plugin/resource_collection_rc.py"
]
subprocess.run(cmd)
with open("src/cloudcompare_python_plugin/main_window_ui.py", "r+", encoding="utf-8") as f:
txt = f.read()
txt = txt.replace("import resource_collection_rc", "from . import resource_collection_rc")
f.seek(0)
f.write(txt)
f.truncate()