diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-02-24 14:42:57 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-02-28 09:13:48 +0100 |
commit | 77d002b7ccf2cd8ff7844792365f317eac341c2a (patch) | |
tree | eaacc3f045a7dc6439ee2d5a1b36a5340288c473 /sources/pyside-tools/pyside_tool.py | |
parent | 76dfa5db6ddd95bd4f8189425f64c1763970e7d3 (diff) |
Fix entry points for UI tools on macOS
Use the app bundle path. Amends
ba96669d4ad0c31b8703231a9346218c6b92df70 and
011cad7cd2cd617427e939d737676394425bdc6b.
Pick-to: 6.2
Task-number: PYSIDE-1831
Task-number: PYSIDE-1378
Task-number: PYSIDE-1252
Change-Id: Icfe5badda3d900b8bad8f58edab6447a901d07e6
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside-tools/pyside_tool.py')
-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 e05a4d586..984480d41 100644 --- a/sources/pyside-tools/pyside_tool.py +++ b/sources/pyside-tools/pyside_tool.py @@ -82,6 +82,14 @@ def pyside_script_wrapper(script_name): sys.exit(subprocess.call(command)) +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:]) @@ -107,7 +115,7 @@ def qmllint(): 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): @@ -151,14 +159,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(): |