logo

searx

Unnamed repository; edit this file 'description' to name the repository.
commit: 86daef2063a83a6aee90e9f269644e0803ae9cb9
parent: bee7b497a300622f5ba2b619817f5c89c29ae871
Author: Adam Tauber <asciimoo@gmail.com>
Date:   Wed, 28 Sep 2016 22:30:05 +0200

[fix] do not allow underscore in engine names - closes #708

Diffstat:

searx/engines/__init__.py | 12+++++++++---
searx/settings.yml | 2+-
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py @@ -57,11 +57,17 @@ def load_module(filename): def load_engine(engine_data): - engine_name = engine_data['engine'] + + if '_' in engine_data['name']: + logger.error('Engine name conains underscore: "{}"'.format(engine_data['name'])) + sys.exit(1) + + engine_module = engine_data['engine'] + try: - engine = load_module(engine_name + '.py') + engine = load_module(engine_module + '.py') except: - logger.exception('Cannot load engine "{}"'.format(engine_name)) + logger.exception('Cannot load engine "{}"'.format(engine_module)) return None for param_name in engine_data: diff --git a/searx/settings.yml b/searx/settings.yml @@ -377,7 +377,7 @@ engines: timeout : 10.0 disabled : True - - name : scanr_structures + - name : scanr structures shortcut: scs engine : scanr_structures disabled : True