mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
TemplatesDict does not return objected templates with 'templates' attribute
This commit is contained in:
parent
899e59b059
commit
43839e63f1
3 changed files with 46 additions and 27 deletions
|
|
@ -227,15 +227,18 @@ class TemplatesDict(object):
|
|||
def __init__(self, templates=None):
|
||||
self._raw_templates = None
|
||||
self._templates = None
|
||||
self._objected_templates = None
|
||||
self.set_templates(templates)
|
||||
|
||||
def set_templates(self, templates):
|
||||
if templates is None:
|
||||
self._raw_templates = None
|
||||
self._templates = None
|
||||
self._objected_templates = None
|
||||
elif isinstance(templates, dict):
|
||||
self._raw_templates = copy.deepcopy(templates)
|
||||
self._templates = self.create_ojected_templates(templates)
|
||||
self._templates = templates
|
||||
self._objected_templates = self.create_ojected_templates(templates)
|
||||
else:
|
||||
raise TypeError("<{}> argument must be a dict, not {}.".format(
|
||||
self.__class__.__name__, str(type(templates))
|
||||
|
|
@ -255,6 +258,10 @@ class TemplatesDict(object):
|
|||
def templates(self):
|
||||
return self._templates
|
||||
|
||||
@property
|
||||
def objected_templates(self):
|
||||
return self._objected_templates
|
||||
|
||||
@classmethod
|
||||
def create_ojected_templates(cls, templates):
|
||||
if not isinstance(templates, dict):
|
||||
|
|
@ -325,7 +332,7 @@ class TemplatesDict(object):
|
|||
if env_key not in data:
|
||||
data[env_key] = val
|
||||
|
||||
solved = self._solve_dict(self.templates, data)
|
||||
solved = self._solve_dict(self.objected_templates, data)
|
||||
|
||||
output = TemplatesResultDict(solved)
|
||||
output.strict = strict
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue