removed unused 'get_non_python_host_kwargs'

This commit is contained in:
Jakub Trllo 2024-03-25 16:29:16 +01:00
parent 4fb898615b
commit 2c07fb4503

View file

@ -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