Browse Source

[enh] add "inactive" attribute to engines

This modification allows us to deactivate engines in settings.yml
without commenting them out
Adam Tauber 7 years ago
parent
commit
1794f6a4d3
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      searx/engines/__init__.py

+ 2
- 0
searx/engines/__init__.py View File

94
             logger.debug('Starting background initialization of %s engine', engine_data['name'])
94
             logger.debug('Starting background initialization of %s engine', engine_data['name'])
95
             threading.Thread(target=engine_init).start()
95
             threading.Thread(target=engine_init).start()
96
             continue
96
             continue
97
+        if engine_attr == 'inactive' and getattr(engine, engine_attr) is True:
98
+            return None
97
         if getattr(engine, engine_attr) is None:
99
         if getattr(engine, engine_attr) is None:
98
             logger.error('Missing engine config attribute: "{0}.{1}"'
100
             logger.error('Missing engine config attribute: "{0}.{1}"'
99
                          .format(engine.name, engine_attr))
101
                          .format(engine.name, engine_attr))