summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2017-07-19 21:30:18 +0200
committerAdam Tauber <asciimoo@gmail.com>2017-07-20 13:32:20 +0200
commit1794f6a4d36cafcc4eb2a64e0145d937bc81bc34 (patch)
treeb7536c481ef8f99775edc5cd8ceda0115cd41463 /searx/engines
parent80331cc8e622cd66ce96d046fd80530ddc852091 (diff)
downloadsearxng-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')
-rw-r--r--searx/engines/__init__.py2
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))