renamed 'get_referenced_containers' -> 'get_containers'

This commit is contained in:
Jakub Trllo 2022-06-27 14:10:35 +02:00
parent 96218779a2
commit 918ee53183
3 changed files with 6 additions and 6 deletions

View file

@ -234,14 +234,14 @@ class ILoadHost:
raise MissingMethodsError(host, missing)
@abstractmethod
def get_referenced_containers(self):
def get_containers(self):
"""Retreive referenced containers from scene.
This can be implemented in hosts where referencing can be used.
Todo:
Rename function to something more self explanatory.
Suggestion: 'get_referenced_containers'
Suggestion: 'get_containers'
Returns:
list[dict]: Information about loaded containers.
@ -251,13 +251,13 @@ class ILoadHost:
# --- Deprecated method names ---
def ls(self):
"""Deprecated variant of 'get_referenced_containers'.
"""Deprecated variant of 'get_containers'.
Todo:
Remove when all usages are replaced.
"""
return self.get_referenced_containers()
return self.get_containers()
@six.add_metaclass(ABCMeta)

View file

@ -115,7 +115,7 @@ class MayaHost(HostBase, IWorkfileHost, ILoadHost):
def get_workfile_extensions(self):
return file_extensions()
def get_referenced_containers(self):
def get_containers(self):
return ls()
@contextlib.contextmanager

View file

@ -195,7 +195,7 @@ class InventoryModel(TreeModel):
host = registered_host()
if not items: # for debugging or testing, injecting items from outside
if isinstance(host, ILoadHost):
items = host.get_referenced_containers()
items = host.get_containers()
else:
items = host.ls()