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

Commit

Permalink
feat: add more hint when tool cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
seanwu1105 committed Jun 14, 2023
1 parent dcb6379 commit 3c14fa7
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 8 deletions.
6 changes: 5 additions & 1 deletion python/scripts/designer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
elif is_installed("PySide2"):
from PySide2.scripts.pyside_tool import designer
else:
sys.exit("No rcc can be found in current Python environment.")
ERR_MSG = (
"No rcc can be found in the current Python environment. "
"Make sure the latest PySide6 or PySide2 is installed."
)
sys.exit(ERR_MSG)
sys.exit(designer())
6 changes: 5 additions & 1 deletion python/scripts/linguist.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
elif is_installed("PySide6"):
from PySide6.scripts.pyside_tool import linguist
else:
sys.exit("No Qt Linguist can be found in current Python environment.")
ERR_MSG = (
"No Qt Linguist can be found in the current Python environment. "
"Make sure the latest PySide6 is installed."
)
sys.exit(ERR_MSG)

sys.exit(linguist())
6 changes: 5 additions & 1 deletion python/scripts/lrelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
elif is_installed("PySide6"):
from PySide6.scripts.pyside_tool import lrelease
else:
sys.exit("No lrelease can be found in current Python environment.")
ERR_MSG = (
"No lrelease can be found in the current Python environment. "
"Make sure the latest PySide6 is installed."
)
sys.exit(ERR_MSG)
sys.exit(lrelease())
6 changes: 5 additions & 1 deletion python/scripts/lupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
elif is_installed("PyQt5"):
from PyQt5.pylupdate_main import main as lupdate
else:
sys.exit("No lupdate can be found in current Python environment.")
ERR_MSG = (
"No lupdate can be found in the current Python environment. "
"Make sure the latest PySide6, PySide2, PyQt6 or PyQt5 is installed."
)
sys.exit(ERR_MSG)

sys.exit(lupdate())
6 changes: 5 additions & 1 deletion python/scripts/qml.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
elif is_installed("PySide6"):
from PySide6.scripts.pyside_tool import qml
else:
sys.exit("No pyside6-qml can be found in current Python environment.")
ERR_MSG = (
"No pyside6-qml can be found in the current Python environment. "
"Make sure the latest PySide6 is installed."
)
sys.exit(ERR_MSG)
sys.exit(qml())
7 changes: 6 additions & 1 deletion python/scripts/qmlls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,10 @@
elif is_installed("PySide6"):
from PySide6.scripts.pyside_tool import qmlls
else:
sys.exit("No qmlls can be found in current Python environment.")
ERR_MSG = (
"No qmlls can be found in the current Python environment. "
"Make sure the latest PySide6 is installed. "
"Update configuration to disable qmlls integration if you don't need it."
)
sys.exit(ERR_MSG)
sys.exit(qmlls())
6 changes: 5 additions & 1 deletion python/scripts/rcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
elif is_installed("PyQt5"):
from PyQt5.pyrcc_main import main as rcc
else:
sys.exit("No rcc can be found in current Python environment.")
ERR_MSG = (
"No rcc can be found in the current Python environment. "
"Make sure the latest PySide6, PySide2 or PyQt5 is installed."
)
sys.exit(ERR_MSG)
sys.exit(rcc())
6 changes: 5 additions & 1 deletion python/scripts/uic.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@
elif is_installed("PyQt5"):
from PyQt5.uic.pyuic import main as uic
else:
sys.exit("No uic can be found in current Python environment.")
ERR_MSG = (
"No uic can be found in the current Python environment. "
"Make sure the latest PySide6, PySide2, PyQt6 or PyQt5 is installed."
)
sys.exit(ERR_MSG)
sys.exit(uic())

0 comments on commit 3c14fa7

Please sign in to comment.