Explorar el Código

[enh] add "inactive" attribute to engines

This modification allows us to deactivate engines in settings.yml
without commenting them out
Adam Tauber hace 7 años
padre
commit
1794f6a4d3
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2
    0
      searx/engines/__init__.py

+ 2
- 0
searx/engines/__init__.py Ver fichero

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