[fix] searx.plugins.initialize() - don't miss module & module-name

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2021-10-07 18:41:41 +02:00
parent 2b4fef7118
commit aa5a5147b2
1 changed files with 4 additions and 4 deletions

View File

@ -234,9 +234,9 @@ def plugin_module_names():
yield_plugins = set() yield_plugins = set()
# embedded plugins # embedded plugins
for module_name in iter_modules(path=[dirname(__file__)]): for module in iter_modules(path=[dirname(__file__)]):
yield (module_name, False) yield (__name__ + "." + module.name, False)
yield_plugins.add(module_name) yield_plugins.add(module.name)
# external plugins # external plugins
for module_name in settings['plugins']: for module_name in settings['plugins']:
if module_name not in yield_plugins: if module_name not in yield_plugins:
@ -246,6 +246,6 @@ def plugin_module_names():
def initialize(app): def initialize(app):
for module_name, external in plugin_module_names(): for module_name, external in plugin_module_names():
plugin = load_and_initialize_plugin(__name__ + "." + module_name.name, external, (app, settings)) plugin = load_and_initialize_plugin(module_name, external, (app, settings))
if plugin: if plugin:
plugins.register(plugin) plugins.register(plugin)