diff options
-rw-r--r-- | sources/pyside-tools/pyside_tool.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sources/pyside-tools/pyside_tool.py b/sources/pyside-tools/pyside_tool.py index 5045c40c7..cb8394ceb 100644 --- a/sources/pyside-tools/pyside_tool.py +++ b/sources/pyside-tools/pyside_tool.py @@ -75,6 +75,14 @@ def qt_tool_wrapper(qt_tool, args, libexec=False): sys.exit(proc.returncode) +def ui_tool_binary(binary): + """Return the binary of a UI tool (App bundle on macOS).""" + if sys.platform != "darwin": + return binary + name = binary[0:1].upper() + binary[1:] + return f"{name}.app/Contents/MacOS/{name}" + + def lrelease(): qt_tool_wrapper("lrelease", sys.argv[1:]) @@ -92,7 +100,7 @@ def rcc(): def assistant(): - qt_tool_wrapper("assistant", sys.argv[1:]) + qt_tool_wrapper(ui_tool_binary("assistant"), sys.argv[1:]) def _append_to_path_var(var, value): @@ -136,14 +144,11 @@ def designer(): taskmenu_dir = os.fspath(pyside_dir / 'examples' / 'designer' / 'taskmenuextension') _append_to_path_var('PYSIDE_DESIGNER_PLUGINS', taskmenu_dir) - if sys.platform == "darwin": - qt_tool_wrapper("Designer.app/Contents/MacOS/Designer", sys.argv[1:]) - else: - qt_tool_wrapper("designer", sys.argv[1:]) + qt_tool_wrapper(ui_tool_binary("designer"), sys.argv[1:]) def linguist(): - qt_tool_wrapper("linguist", sys.argv[1:]) + qt_tool_wrapper(ui_tool_binary("linguist"), sys.argv[1:]) def genpyi(): |