mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Removed unneeded _load_context
This commit is contained in:
parent
976ef5fb2b
commit
4c113ca5b5
1 changed files with 3 additions and 48 deletions
|
|
@ -321,14 +321,7 @@ def load_with_repre_context(
|
|||
)
|
||||
|
||||
loader = Loader()
|
||||
return _load_context(
|
||||
Loader,
|
||||
repre_context,
|
||||
name,
|
||||
namespace,
|
||||
options,
|
||||
hooks
|
||||
)
|
||||
loader.load(repre_context, name, namespace, options)
|
||||
|
||||
|
||||
def load_with_product_context(
|
||||
|
|
@ -355,14 +348,7 @@ def load_with_product_context(
|
|||
Loader.__name__, product_context["folder"]["path"]
|
||||
)
|
||||
)
|
||||
return _load_context(
|
||||
Loader,
|
||||
product_context,
|
||||
name,
|
||||
namespace,
|
||||
options,
|
||||
hooks
|
||||
)
|
||||
return Loader().load(product_context, name, namespace, options)
|
||||
|
||||
|
||||
def load_with_product_contexts(
|
||||
|
|
@ -393,38 +379,7 @@ def load_with_product_contexts(
|
|||
Loader.__name__, joined_product_names
|
||||
)
|
||||
)
|
||||
return _load_context(
|
||||
Loader,
|
||||
product_contexts,
|
||||
name,
|
||||
namespace,
|
||||
options,
|
||||
hooks
|
||||
)
|
||||
|
||||
|
||||
def _load_context(Loader, contexts, name, namespace, options, hooks):
|
||||
"""Helper function to wrap hooks around generic load function.
|
||||
|
||||
Only dynamic part is different context(s) to be loaded.
|
||||
"""
|
||||
for hook_plugin_cls in hooks.get("pre", []):
|
||||
hook_plugin_cls().process(
|
||||
contexts,
|
||||
name,
|
||||
namespace,
|
||||
options,
|
||||
)
|
||||
loaded_container = Loader().load(contexts, name, namespace, options)
|
||||
for hook_plugin_cls in hooks.get("post", []):
|
||||
hook_plugin_cls().process(
|
||||
loaded_container,
|
||||
contexts,
|
||||
name,
|
||||
namespace,
|
||||
options,
|
||||
)
|
||||
return loaded_container
|
||||
return Loader().load(product_contexts, name, namespace, options)
|
||||
|
||||
|
||||
def load_container(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue