Skip to content

Commit

Permalink
Merge pull request #498 from ynput/enhancement/running-from-ayon-laun…
Browse files Browse the repository at this point in the history
…cher

Chore: Be able to determine if is in AYON launcher process
  • Loading branch information
iLLiCiTiT authored May 9, 2024
2 parents d51e7a9 + a19350e commit 79c2547
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/ayon_core/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
)

from .ayon_info import (
is_in_ayon_launcher_process,
is_running_from_build,
is_using_ayon_console,
is_staging_enabled,
Expand Down Expand Up @@ -248,6 +249,7 @@

"Logger",

"is_in_ayon_launcher_process",
"is_running_from_build",
"is_using_ayon_console",
"is_staging_enabled",
Expand Down
13 changes: 13 additions & 0 deletions client/ayon_core/lib/ayon_info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
import json
import datetime
import platform
Expand All @@ -25,6 +26,18 @@ def get_ayon_launcher_version():
return content["__version__"]


def is_in_ayon_launcher_process():
"""Determine if current process is running from AYON launcher.
Returns:
bool: True if running from AYON launcher.
"""
ayon_executable_path = os.path.normpath(os.environ["AYON_EXECUTABLE"])
executable_path = os.path.normpath(sys.executable)
return ayon_executable_path == executable_path


def is_running_from_build():
"""Determine if current process is running from build or code.
Expand Down

0 comments on commit 79c2547

Please sign in to comment.