diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-03-10 12:55:53 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-03-13 17:09:03 +0100 |
commit | 6361e496af31d346578245687f3823066f0330c5 (patch) | |
tree | 8a1a9e4ab7ac980a924ce04dc4c3bbda774d813a /sources/pyside-tools | |
parent | 665d01d76fdd5d511255be171f92a6c51a8b53a7 (diff) |
pyside6-designer: Prepend virtual env path on Windows
Task-number: PYSIDE-2251
Pick-to: 6.4
Change-Id: I0efe24e5b92bae82c122d156b7dc4e7aca07c957
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside-tools')
-rw-r--r-- | sources/pyside-tools/pyside_tool.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sources/pyside-tools/pyside_tool.py b/sources/pyside-tools/pyside_tool.py index cc60ab84f..5e5f857bc 100644 --- a/sources/pyside-tools/pyside_tool.py +++ b/sources/pyside-tools/pyside_tool.py @@ -116,10 +116,11 @@ def assistant(): qt_tool_wrapper(ui_tool_binary("assistant"), sys.argv[1:]) -def _append_to_path_var(var, value): +def _extend_path_var(var, value, prepend=False): env_value = os.environ.get(var) if env_value: - env_value = f'{env_value}{os.pathsep}{value}' + env_value = (f'{value}{os.pathsep}{env_value}' + if prepend else f'{env_value}{os.pathsep}{value}') else: env_value = value os.environ[var] = env_value @@ -156,12 +157,12 @@ def designer(): elif sys.platform == 'win32': # Find Python DLLs from the base installation if is_virtual_env(): - _append_to_path_var("PATH", os.fspath(Path(sys._base_executable).parent)) + _extend_path_var("PATH", os.fspath(Path(sys._base_executable).parent), True) # Add the Wiggly Widget example wiggly_dir = os.fspath(pyside_dir / 'examples' / 'widgetbinding') - _append_to_path_var('PYSIDE_DESIGNER_PLUGINS', wiggly_dir) + _extend_path_var('PYSIDE_DESIGNER_PLUGINS', wiggly_dir) taskmenu_dir = os.fspath(pyside_dir / 'examples' / 'designer' / 'taskmenuextension') - _append_to_path_var('PYSIDE_DESIGNER_PLUGINS', taskmenu_dir) + _extend_path_var('PYSIDE_DESIGNER_PLUGINS', taskmenu_dir) qt_tool_wrapper(ui_tool_binary("designer"), sys.argv[1:]) |