mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
used plugin collect helper in code
This commit is contained in:
parent
871794d761
commit
77dc378e07
3 changed files with 5 additions and 29 deletions
9
pype.py
9
pype.py
|
|
@ -76,7 +76,6 @@ def set_modules_environments():
|
|||
|
||||
modules_manager = ModulesManager()
|
||||
|
||||
publish_plugin_dirs = []
|
||||
module_envs = {}
|
||||
for module in modules_manager.get_enabled_modules():
|
||||
# Collect global module's global environments
|
||||
|
|
@ -89,13 +88,7 @@ def set_modules_environments():
|
|||
)
|
||||
module_envs[key] = value
|
||||
|
||||
# Collect plugin paths for publishing
|
||||
if isinstance(module, IPluginPaths):
|
||||
plugins_data = module.get_plugin_paths() or {}
|
||||
publish_paths = plugins_data.get("publish") or []
|
||||
if not isinstance(publish_paths, (tuple, list, set)):
|
||||
publish_paths = [publish_paths]
|
||||
publish_plugin_dirs.extend(publish_paths)
|
||||
publish_plugin_dirs = modules_manager.collect_plugin_paths()["publish"]
|
||||
|
||||
# Set pyblish plugins paths if any module want to register them
|
||||
if publish_plugin_dirs:
|
||||
|
|
|
|||
|
|
@ -114,20 +114,8 @@ class AvalonModule(PypeModule, ITrayModule, IRestApi):
|
|||
exc_info=True
|
||||
)
|
||||
|
||||
def connect_with_modules(self, enabled_modules):
|
||||
plugin_paths = []
|
||||
for module in enabled_modules:
|
||||
if not isinstance(module, IPluginPaths):
|
||||
continue
|
||||
|
||||
paths = (module.get_plugin_paths() or {}).get("actions")
|
||||
if not paths:
|
||||
continue
|
||||
|
||||
if not isinstance(paths, (list, tuple, set)):
|
||||
paths = [paths]
|
||||
plugin_paths.extend(paths)
|
||||
|
||||
def connect_with_modules(self, _enabled_modules):
|
||||
plugin_paths = self.module.collect_plugin_paths()["actions"]
|
||||
if plugin_paths:
|
||||
env_paths_str = os.environ.get("AVALON_ACTIONS") or ""
|
||||
env_paths = env_paths_str.split(os.pathsep)
|
||||
|
|
|
|||
|
|
@ -34,13 +34,8 @@ class StandAlonePublishModule(PypeModule, ITrayModule):
|
|||
|
||||
def connect_with_modules(self, enabled_modules):
|
||||
"""Collect publish paths from other modules."""
|
||||
for module in enabled_modules:
|
||||
if isinstance(module, IPluginPaths):
|
||||
plugin_paths = module.get_plugin_paths() or {}
|
||||
publish_paths = plugin_paths.get("publish") or []
|
||||
if not isinstance(publish_paths, (list, tuple, set)):
|
||||
publish_paths = [publish_paths]
|
||||
self.publish_paths.extend(publish_paths)
|
||||
publish_paths = self.module.collect_plugin_paths()["publish"]
|
||||
self.publish_paths.extend(publish_paths)
|
||||
|
||||
def run_standalone_publisher(self):
|
||||
from pype import tools
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue