on master help sign in
[enh] add "inactive" attribute to engines

This modification allows us to deactivate engines in settings.yml without commenting them out

commit1794f6a4d36cafcc4eb2a64e0145d937bc81bc34 authorAdam Tauber <asciimoo@gmail.com> dateWed 19 Jul 2017, 21:30 (9 years ago) parent80331cc
1 file changed+2
searx/engines/__init__.py+2
searx/engines/__init__.py+2
@@ -94,6 +94,8 @@ def load_engine(engine_data):
9494 logger.debug('Starting background initialization of %s engine', engine_data['name'])
9595 threading.Thread(target=engine_init).start()
9696 continue
97+ if engine_attr == 'inactive' and getattr(engine, engine_attr) is True:
98+ return None
9799 if getattr(engine, engine_attr) is None:
98100 logger.error('Missing engine config attribute: "{0}.{1}"'
99101 .format(engine.name, engine_attr))