Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 3c14fa7

Browse files
committed
feat: add more hint when tool cannot be found
1 parent dcb6379 commit 3c14fa7

File tree

8 files changed

+41
-8
lines changed

8 files changed

+41
-8
lines changed

python/scripts/designer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@
1616
elif is_installed("PySide2"):
1717
from PySide2.scripts.pyside_tool import designer
1818
else:
19-
sys.exit("No rcc can be found in current Python environment.")
19+
ERR_MSG = (
20+
"No rcc can be found in the current Python environment. "
21+
"Make sure the latest PySide6 or PySide2 is installed."
22+
)
23+
sys.exit(ERR_MSG)
2024
sys.exit(designer())

python/scripts/linguist.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
elif is_installed("PySide6"):
1313
from PySide6.scripts.pyside_tool import linguist
1414
else:
15-
sys.exit("No Qt Linguist can be found in current Python environment.")
15+
ERR_MSG = (
16+
"No Qt Linguist can be found in the current Python environment. "
17+
"Make sure the latest PySide6 is installed."
18+
)
19+
sys.exit(ERR_MSG)
1620

1721
sys.exit(linguist())

python/scripts/lrelease.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@
1212
elif is_installed("PySide6"):
1313
from PySide6.scripts.pyside_tool import lrelease
1414
else:
15-
sys.exit("No lrelease can be found in current Python environment.")
15+
ERR_MSG = (
16+
"No lrelease can be found in the current Python environment. "
17+
"Make sure the latest PySide6 is installed."
18+
)
19+
sys.exit(ERR_MSG)
1620
sys.exit(lrelease())

python/scripts/lupdate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
elif is_installed("PyQt5"):
2727
from PyQt5.pylupdate_main import main as lupdate
2828
else:
29-
sys.exit("No lupdate can be found in current Python environment.")
29+
ERR_MSG = (
30+
"No lupdate can be found in the current Python environment. "
31+
"Make sure the latest PySide6, PySide2, PyQt6 or PyQt5 is installed."
32+
)
33+
sys.exit(ERR_MSG)
3034

3135
sys.exit(lupdate())

python/scripts/qml.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@
1212
elif is_installed("PySide6"):
1313
from PySide6.scripts.pyside_tool import qml
1414
else:
15-
sys.exit("No pyside6-qml can be found in current Python environment.")
15+
ERR_MSG = (
16+
"No pyside6-qml can be found in the current Python environment. "
17+
"Make sure the latest PySide6 is installed."
18+
)
19+
sys.exit(ERR_MSG)
1620
sys.exit(qml())

python/scripts/qmlls.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@
1212
elif is_installed("PySide6"):
1313
from PySide6.scripts.pyside_tool import qmlls
1414
else:
15-
sys.exit("No qmlls can be found in current Python environment.")
15+
ERR_MSG = (
16+
"No qmlls can be found in the current Python environment. "
17+
"Make sure the latest PySide6 is installed. "
18+
"Update configuration to disable qmlls integration if you don't need it."
19+
)
20+
sys.exit(ERR_MSG)
1621
sys.exit(qmlls())

python/scripts/rcc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,9 @@
2020
elif is_installed("PyQt5"):
2121
from PyQt5.pyrcc_main import main as rcc
2222
else:
23-
sys.exit("No rcc can be found in current Python environment.")
23+
ERR_MSG = (
24+
"No rcc can be found in the current Python environment. "
25+
"Make sure the latest PySide6, PySide2 or PyQt5 is installed."
26+
)
27+
sys.exit(ERR_MSG)
2428
sys.exit(rcc())

python/scripts/uic.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@
2424
elif is_installed("PyQt5"):
2525
from PyQt5.uic.pyuic import main as uic
2626
else:
27-
sys.exit("No uic can be found in current Python environment.")
27+
ERR_MSG = (
28+
"No uic can be found in the current Python environment. "
29+
"Make sure the latest PySide6, PySide2, PyQt6 or PyQt5 is installed."
30+
)
31+
sys.exit(ERR_MSG)
2832
sys.exit(uic())

0 commit comments

Comments
 (0)