🚨 unify output messages

This commit is contained in:
Ondřej Samohel 2022-08-04 13:25:56 +02:00
parent 03c648c8fd
commit 53877ebe96
No known key found for this signature in database
GPG key ID: 02376E18990A97C6

View file

@ -70,11 +70,11 @@ def inject_openpype_environment(deadlinePlugin):
# lets go over all available and find compatible build. # lets go over all available and find compatible build.
requested_version = job.GetJobEnvironmentKeyValue("OPENPYPE_VERSION") requested_version = job.GetJobEnvironmentKeyValue("OPENPYPE_VERSION")
if requested_version: if requested_version:
print(("Scanning for compatible requested " print((">>> Scanning for compatible requested "
f"version {requested_version}")) f"version {requested_version}"))
install_dir = DirectoryUtils.SearchDirectoryList(dir_list) install_dir = DirectoryUtils.SearchDirectoryList(dir_list)
if install_dir: if install_dir:
print(f"Looking for OpenPype at: {install_dir}") print(f"--- Looking for OpenPype at: {install_dir}")
sub_dirs = [ sub_dirs = [
f.path for f in os.scandir(install_dir) f.path for f in os.scandir(install_dir)
if f.is_dir() if f.is_dir()
@ -83,7 +83,7 @@ def inject_openpype_environment(deadlinePlugin):
version = get_openpype_version_from_path(subdir) version = get_openpype_version_from_path(subdir)
if not version: if not version:
continue continue
print(f" - found: {version} - {subdir}") print(f" - found: {version} - {subdir}")
openpype_versions.append((version, subdir)) openpype_versions.append((version, subdir))
exe = FileUtils.SearchFileList(exe_list) exe = FileUtils.SearchFileList(exe_list)
@ -94,14 +94,14 @@ def inject_openpype_environment(deadlinePlugin):
version = get_openpype_version_from_path( version = get_openpype_version_from_path(
os.path.dirname(exe)) os.path.dirname(exe))
if version: if version:
print(f" - found: {version} - {os.path.dirname(exe)}") print(f" - found: {version} - {os.path.dirname(exe)}")
openpype_versions.append((version, os.path.dirname(exe))) openpype_versions.append((version, os.path.dirname(exe)))
if requested_version: if requested_version:
# sort detected versions # sort detected versions
if openpype_versions: if openpype_versions:
openpype_versions.sort(key=lambda ver: ver[0]) openpype_versions.sort(key=lambda ver: ver[0])
print(("Latest available version found is " print(("*** Latest available version found is "
f"{openpype_versions[-1][0]}")) f"{openpype_versions[-1][0]}"))
requested_major, requested_minor, _ = requested_version.split(".")[:3] # noqa: E501 requested_major, requested_minor, _ = requested_version.split(".")[:3] # noqa: E501
compatible_versions = [] compatible_versions = []
@ -118,7 +118,7 @@ def inject_openpype_environment(deadlinePlugin):
"directory.").format(requested_version)) "directory.").format(requested_version))
# sort compatible versions nad pick the last one # sort compatible versions nad pick the last one
compatible_versions.sort(key=lambda ver: ver[0]) compatible_versions.sort(key=lambda ver: ver[0])
print(("Latest compatible version found is " print(("*** Latest compatible version found is "
f"{compatible_versions[-1][0]}")) f"{compatible_versions[-1][0]}"))
# create list of executables for different platform and let # create list of executables for different platform and let
# Deadline decide. # Deadline decide.