added 'is_running_from_build' function

This commit is contained in:
iLLiCiTiT 2021-09-14 15:56:09 +02:00
parent b71898e1d8
commit 39233653f8

View file

@ -25,10 +25,23 @@ def get_pype_version():
return get_openpype_version()
def is_running_from_build():
"""Determine if current process is running from build or code.
Returns:
bool: True if running from build.
"""
executable_path = os.environ["OPENPYPE_EXECUTABLE"]
executable_filename = os.path.basename(executable_path)
if "python" in executable_filename.lower():
return False
return True
def get_pype_info():
"""Information about currently used Pype process."""
executable_args = get_pype_execute_args()
if len(executable_args) == 1:
if is_running_from_build():
version_type = "build"
else:
version_type = "code"