From 1794f6a4d36cafcc4eb2a64e0145d937bc81bc34 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 19 Jul 2017 21:30:18 +0200 Subject: [PATCH] [enh] add "inactive" attribute to engines This modification allows us to deactivate engines in settings.yml without commenting them out --- searx/engines/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index a439c355b..48c9b7e4a 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -94,6 +94,8 @@ def load_engine(engine_data): logger.debug('Starting background initialization of %s engine', engine_data['name']) threading.Thread(target=engine_init).start() continue + if engine_attr == 'inactive' and getattr(engine, engine_attr) is True: + return None if getattr(engine, engine_attr) is None: logger.error('Missing engine config attribute: "{0}.{1}"' .format(engine.name, engine_attr))