mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
added functions to get expected studio version
This commit is contained in:
parent
7aec21aa80
commit
8f0f076980
2 changed files with 40 additions and 1 deletions
|
|
@ -22,7 +22,10 @@ from .user_settings import (
|
|||
OpenPypeSecureRegistry,
|
||||
OpenPypeSettingsRegistry
|
||||
)
|
||||
from .tools import get_openpype_path_from_db
|
||||
from .tools import (
|
||||
get_openpype_path_from_db,
|
||||
get_expected_studio_version_str
|
||||
)
|
||||
|
||||
|
||||
LOG_INFO = 0
|
||||
|
|
@ -571,6 +574,24 @@ class OpenPypeVersion(semver.VersionInfo):
|
|||
|
||||
return openpype_versions[-1]
|
||||
|
||||
@classmethod
|
||||
def get_expected_studio_version(cls, staging=False):
|
||||
"""Expected OpenPype version that should be used at the moment.
|
||||
|
||||
If version is not defined in settings the latest found version is
|
||||
used.
|
||||
|
||||
Args:
|
||||
staging (bool): Staging version or production version.
|
||||
|
||||
Returns:
|
||||
OpenPypeVersion: Version that should be used.
|
||||
"""
|
||||
result = get_expected_studio_version_str(staging)
|
||||
if not result:
|
||||
return cls.get_latest_version(staging, False)
|
||||
return OpenPypeVersion(version=result)
|
||||
|
||||
|
||||
class BootstrapRepos:
|
||||
"""Class for bootstrapping local OpenPype installation.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue