mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Anatomy object can work as dictionary
This commit is contained in:
parent
6c5b0ea93e
commit
f3f75d9615
1 changed files with 18 additions and 0 deletions
|
|
@ -60,6 +60,24 @@ class Anatomy:
|
|||
self._templates_obj = Templates(parent=self)
|
||||
self._roots_obj = Roots(parent=self)
|
||||
|
||||
# Anatomy used as dictionary
|
||||
# - implemented only getters returning copy
|
||||
def __getitem__(self, key):
|
||||
return copy.deepcopy(self._data[key])
|
||||
|
||||
def get(self, key, default=None):
|
||||
return copy.deepcopy(self._data).get(key, default)
|
||||
|
||||
def keys(self):
|
||||
return copy.deepcopy(self._data).keys()
|
||||
|
||||
def values(self):
|
||||
return copy.deepcopy(self._data).values()
|
||||
|
||||
def items(self):
|
||||
return copy.deepcopy(self._data).items()
|
||||
|
||||
|
||||
def reset(self):
|
||||
"""Reset values of cached data in templates and roots objects."""
|
||||
self.templates_obj.reset()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue