logo

searx

Unnamed repository; edit this file 'description' to name the repository.
commit: 1a2cf205f96f1f952237727d36387d81fe937fcf
parent: 4cc391169a0c0d3ea8d0535bc1baebe2bf5c8346
Author: asciimoo <asciimoo@gmail.com>
Date:   Mon,  4 Nov 2013 21:46:23 +0100

[enh] skipping empty/nonetype categories

Diffstat:

searx/engines/__init__.py | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py @@ -59,7 +59,10 @@ for section in engines_config.sections(): if param_name == 'engine': continue if param_name == 'categories': - engine.categories = map(str.strip, engines_config.get(section, param_name).split(',')) + if engines_config.get(section, param_name) == 'none': + engine.categories = [] + else: + 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):