From be43d5d9b78301b039da2e7b92a3252a6f341a41 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Tue, 10 Apr 2018 10:16:06 +0100 Subject: [PATCH] fw/config: add plugin_paths property to settings Add plugin_paths property to settings which combines plugins_directory with extra_plugin_paths, and use that inside pluginloader. --- wa/framework/configuration/core.py | 4 ++++ wa/framework/pluginloader.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wa/framework/configuration/core.py b/wa/framework/configuration/core.py index 81a14f9d..0c38baf0 100644 --- a/wa/framework/configuration/core.py +++ b/wa/framework/configuration/core.py @@ -476,6 +476,10 @@ class MetaConfiguration(Configuration): def plugins_directory(self): return os.path.join(self.user_directory, 'plugins') + @property + def plugin_paths(self): + return [self.plugins_directory] + (self.extra_plugin_paths or []) + @property def user_config_file(self): return os.path.join(self.user_directory, 'config.yaml') diff --git a/wa/framework/pluginloader.py b/wa/framework/pluginloader.py index d03fa932..548f42d9 100644 --- a/wa/framework/pluginloader.py +++ b/wa/framework/pluginloader.py @@ -38,7 +38,7 @@ class __LoaderWrapper(object): from wa.framework.plugin import PluginLoader from wa.framework.configuration.core import settings self._loader = PluginLoader(settings.plugin_packages, - [settings.plugins_directory], []) + settings.plugin_paths, []) def update(self, packages=None, paths=None, ignore_paths=None): if not self._loader: