Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Be able to determine if is in AYON launcher process #498

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading