From 5ee0b7bb80b0a88e1e892eb90aea0597553e926e Mon Sep 17 00:00:00 2001 From: asciimoo Date: Sat, 19 Oct 2013 19:01:06 +0200 Subject: [PATCH] [enh] engine blacklist support --- searx/engines/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index 6f02dec54..0b56d5f0a 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -23,6 +23,7 @@ import grequests from itertools import izip_longest, chain from operator import itemgetter from urlparse import urlparse +from searx import settings engine_dir = dirname(realpath(__file__)) @@ -31,9 +32,11 @@ engines = {} categories = {'general': []} for filename in listdir(engine_dir): - modname = splitext(filename)[0] if filename.startswith('_') or not filename.endswith('.py'): continue + modname = splitext(filename)[0] + if modname in settings.blacklist: + continue filepath = join(engine_dir, filename) engine = load_source(modname, filepath) engine.name = modname