mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
removed unused 'get_non_python_host_kwargs'
This commit is contained in:
parent
4fb898615b
commit
2c07fb4503
1 changed files with 0 additions and 39 deletions
|
|
@ -1985,42 +1985,3 @@ def should_workfile_tool_start(
|
|||
if output is None:
|
||||
return default_output
|
||||
return output
|
||||
|
||||
|
||||
def get_non_python_host_kwargs(kwargs, allow_console=True):
|
||||
"""Explicit setting of kwargs for Popen for AE/PS/Harmony.
|
||||
|
||||
Expected behavior
|
||||
- ayon_console opens window with logs
|
||||
- ayon has stdout/stderr available for capturing
|
||||
|
||||
Args:
|
||||
kwargs (dict) or None
|
||||
allow_console (bool): use False for inner Popen opening app itself or
|
||||
it will open additional console (at least for Harmony)
|
||||
"""
|
||||
|
||||
if kwargs is None:
|
||||
kwargs = {}
|
||||
|
||||
if platform.system().lower() != "windows":
|
||||
return kwargs
|
||||
|
||||
executable_path = os.environ.get("AYON_EXECUTABLE")
|
||||
|
||||
executable_filename = ""
|
||||
if executable_path:
|
||||
executable_filename = os.path.basename(executable_path)
|
||||
|
||||
is_gui_executable = "ayon_console" not in executable_filename
|
||||
if is_gui_executable:
|
||||
kwargs.update({
|
||||
"creationflags": subprocess.CREATE_NO_WINDOW,
|
||||
"stdout": subprocess.DEVNULL,
|
||||
"stderr": subprocess.DEVNULL
|
||||
})
|
||||
elif allow_console:
|
||||
kwargs.update({
|
||||
"creationflags": subprocess.CREATE_NEW_CONSOLE
|
||||
})
|
||||
return kwargs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue