diff options
author | Adam Tauber <asciimoo@gmail.com> | 2017-07-19 21:30:18 +0200 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2017-07-20 13:32:20 +0200 |
commit | 1794f6a4d36cafcc4eb2a64e0145d937bc81bc34 (patch) | |
tree | b7536c481ef8f99775edc5cd8ceda0115cd41463 /searx/engines/__init__.py | |
parent | 80331cc8e622cd66ce96d046fd80530ddc852091 (diff) | |
download | searxng-1794f6a4d36cafcc4eb2a64e0145d937bc81bc34.tar.gz searxng-1794f6a4d36cafcc4eb2a64e0145d937bc81bc34.zip |
[enh] add "inactive" attribute to engines
This modification allows us to deactivate engines in settings.yml
without commenting them out
Diffstat (limited to 'searx/engines/__init__.py')
-rw-r--r-- | searx/engines/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
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)) |