浏览代码

[enh] add "inactive" attribute to engines

This modification allows us to deactivate engines in settings.yml
without commenting them out
Adam Tauber 7 年前
父节点
当前提交
1794f6a4d3
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2
    0
      searx/engines/__init__.py

+ 2
- 0
searx/engines/__init__.py 查看文件

@@ -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))