From 34bdeda6d4a23a714244272d328b21f561bff841 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Fri, 25 Oct 2013 23:41:14 +0200 Subject: [PATCH] [enh] basic config check --- searx/engines/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index 495e6aa6f..c6a4b8a35 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -56,6 +56,12 @@ for section in engines_config.sections(): engine.categories = map(str.strip, engines_config.get(section, param_name).split(',')) continue setattr(engine, param_name, engines_config.get(section, param_name)) + for engine_attr in dir(engine): + if engine_attr.startswith('_'): + continue + if getattr(engine, engine_attr) == None: + print '[E] Engine config error: Missing attribute "{0}.{1}"'.format(engine.name, engine_attr) + sys.exit(1) engines[engine.name] = engine if hasattr(engine, 'categories'): for category_name in engine.categories: