mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
cashing OCIO config version data
This commit is contained in:
parent
c99aa746a2
commit
ba237487a6
1 changed files with 6 additions and 4 deletions
|
|
@ -23,6 +23,7 @@ log = Logger.get_logger(__name__)
|
|||
class CashedData:
|
||||
remapping = None
|
||||
python3compatible = None
|
||||
config_version_data = None
|
||||
|
||||
|
||||
class DeprecatedWarning(DeprecationWarning):
|
||||
|
|
@ -395,16 +396,17 @@ def compatibility_check_config_version(config_path, major=1, minor=None):
|
|||
"config", "get_version", config_path=config_path
|
||||
)
|
||||
|
||||
from openpype.scripts.ocio_wrapper import _get_version_data
|
||||
if not CashedData.config_version_data:
|
||||
from openpype.scripts.ocio_wrapper import _get_version_data
|
||||
|
||||
version_data = _get_version_data(config_path)
|
||||
CashedData.config_version_data = _get_version_data(config_path)
|
||||
|
||||
# check major version
|
||||
if version_data["major"] != major:
|
||||
if CashedData.config_version_data["major"] != major:
|
||||
return False
|
||||
|
||||
# check minor version
|
||||
if minor and version_data["minor"] != minor:
|
||||
if minor and CashedData.config_version_data["minor"] != minor:
|
||||
return False
|
||||
|
||||
# compatible
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue