mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
🐛 filter out non-build versions
and fixing the error message
This commit is contained in:
parent
3d7e195307
commit
9ed329aebe
2 changed files with 32 additions and 4 deletions
|
|
@ -10,10 +10,23 @@ import re
|
|||
from Deadline.Scripting import RepositoryUtils, FileUtils, DirectoryUtils
|
||||
|
||||
|
||||
def get_openpype_version_from_path(path):
|
||||
def get_openpype_version_from_path(path, build=True):
|
||||
"""Get OpenPype version from provided path.
|
||||
path (str): Path to scan.
|
||||
build (bool, optional): Get only builds, not sources
|
||||
|
||||
Returns:
|
||||
str or None: version of OpenPype if found.
|
||||
|
||||
"""
|
||||
version_file = os.path.join(path, "openpype", "version.py")
|
||||
if not os.path.isfile(version_file):
|
||||
return None
|
||||
# skip if the version is not build
|
||||
if not build and \
|
||||
(not os.path.isfile(os.path.join(path, "openpype_console")) or
|
||||
not os.path.isfile(os.path.join(path, "openpype_console.exe"))):
|
||||
return None
|
||||
version = {}
|
||||
with open(version_file, "r") as vf:
|
||||
exec(vf.read(), version)
|
||||
|
|
@ -101,7 +114,8 @@ def inject_openpype_environment(deadlinePlugin):
|
|||
if exe == "":
|
||||
raise RuntimeError(
|
||||
"OpenPype executable was not found " +
|
||||
"in the semicolon separated list \"" + exe_list + "\". " +
|
||||
"in the semicolon separated list " +
|
||||
"\"" + ";".join(exe_list) + "\". " +
|
||||
"The path to the render executable can be configured " +
|
||||
"from the Plugin Configuration in the Deadline Monitor.")
|
||||
|
||||
|
|
|
|||
|
|
@ -61,10 +61,23 @@ class OpenPypeDeadlinePlugin(DeadlinePlugin):
|
|||
".*Progress: (\d+)%.*").HandleCallback += self.HandleProgress
|
||||
|
||||
@staticmethod
|
||||
def get_openpype_version_from_path(path):
|
||||
def get_openpype_version_from_path(path, build=True):
|
||||
"""Get OpenPype version from provided path.
|
||||
path (str): Path to scan.
|
||||
build (bool, optional): Get only builds, not sources
|
||||
|
||||
Returns:
|
||||
str or None: version of OpenPype if found.
|
||||
|
||||
"""
|
||||
version_file = os.path.join(path, "openpype", "version.py")
|
||||
if not os.path.isfile(version_file):
|
||||
return None
|
||||
# skip if the version is not build
|
||||
if not build and \
|
||||
(not os.path.isfile(os.path.join(path, "openpype_console")) or
|
||||
not os.path.isfile(os.path.join(path, "openpype_console.exe"))):
|
||||
return None
|
||||
version = {}
|
||||
with open(version_file, "r") as vf:
|
||||
exec(vf.read(), version)
|
||||
|
|
@ -136,7 +149,8 @@ class OpenPypeDeadlinePlugin(DeadlinePlugin):
|
|||
if exe == "":
|
||||
self.FailRender(
|
||||
"OpenPype executable was not found " +
|
||||
"in the semicolon separated list \"" + exe_list + "\". " +
|
||||
"in the semicolon separated list " +
|
||||
"\"" + ";".join(exe_list) + "\". " +
|
||||
"The path to the render executable can be configured " +
|
||||
"from the Plugin Configuration in the Deadline Monitor.")
|
||||
return exe
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue