1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-19 02:40:11 +01:00

[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

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)