fix the reversed logic

This commit is contained in:
Jakub Trllo 2024-03-25 16:51:03 +01:00
parent 5cb07274d1
commit e15460d851
5 changed files with 19 additions and 19 deletions

View file

@ -32,13 +32,13 @@ def get_launch_kwargs(kwargs):
if is_using_ayon_console():
kwargs.update({
"creationflags": subprocess.CREATE_NO_WINDOW,
"stdout": subprocess.DEVNULL,
"stderr": subprocess.DEVNULL
"creationflags": subprocess.CREATE_NEW_CONSOLE
})
else:
kwargs.update({
"creationflags": subprocess.CREATE_NEW_CONSOLE
"creationflags": subprocess.CREATE_NO_WINDOW,
"stdout": subprocess.DEVNULL,
"stderr": subprocess.DEVNULL
})
return kwargs

View file

@ -330,7 +330,7 @@ def launch_zip_file(filepath):
kwargs = {}
if (
platform.system().lower() == "windows"
and is_using_ayon_console()
and not is_using_ayon_console()
):
kwargs.update({
"creationflags": subprocess.CREATE_NO_WINDOW,

View file

@ -32,13 +32,13 @@ def get_launch_kwargs(kwargs):
if is_using_ayon_console():
kwargs.update({
"creationflags": subprocess.CREATE_NO_WINDOW,
"stdout": subprocess.DEVNULL,
"stderr": subprocess.DEVNULL
"creationflags": subprocess.CREATE_NEW_CONSOLE
})
else:
kwargs.update({
"creationflags": subprocess.CREATE_NEW_CONSOLE
"creationflags": subprocess.CREATE_NO_WINDOW,
"stdout": subprocess.DEVNULL,
"stderr": subprocess.DEVNULL
})
return kwargs

View file

@ -30,16 +30,16 @@ def get_launch_kwargs(kwargs):
if platform.system().lower() != "windows":
return kwargs
if is_using_ayon_console():
if not is_using_ayon_console():
kwargs.update({
"creationflags": subprocess.CREATE_NEW_CONSOLE
})
else:
kwargs.update({
"creationflags": subprocess.CREATE_NO_WINDOW,
"stdout": subprocess.DEVNULL,
"stderr": subprocess.DEVNULL
})
else:
kwargs.update({
"creationflags": subprocess.CREATE_NEW_CONSOLE
})
return kwargs

View file

@ -40,10 +40,10 @@ def is_running_from_build():
def is_using_ayon_console():
"""AYON launcher UI windows executable is used.
"""AYON launcher console executable is used.
This function make sense only on Windows platform. For other platforms
always returns False. False is also returned if process is running from
always returns True. True is also returned if process is running from
code.
AYON launcher on windows has 2 executable files. First 'ayon_console.exe'
@ -52,17 +52,17 @@ def is_using_ayon_console():
handled (especially when calling subprocess).
Returns:
bool: True if UI executable is used.
bool: True if console executable is used.
"""
if (
platform.system().lower() != "windows"
or is_running_from_build()
):
return False
return True
executable_path = os.environ["AYON_EXECUTABLE"]
executable_filename = os.path.basename(executable_path)
return "ayon_console" not in executable_filename
return "ayon_console" in executable_filename
def is_staging_enabled():