used plugin collect helper in code

This commit is contained in:
iLLiCiTiT 2020-12-11 11:52:03 +01:00
parent 871794d761
commit 77dc378e07
3 changed files with 5 additions and 29 deletions

View file

@ -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)

View file

@ -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