[enh] engine blacklist support

This commit is contained in:
asciimoo 2013-10-19 19:01:06 +02:00
parent 1308ebf657
commit 5ee0b7bb80
1 changed files with 4 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import grequests
from itertools import izip_longest, chain from itertools import izip_longest, chain
from operator import itemgetter from operator import itemgetter
from urlparse import urlparse from urlparse import urlparse
from searx import settings
engine_dir = dirname(realpath(__file__)) engine_dir = dirname(realpath(__file__))
@ -31,9 +32,11 @@ engines = {}
categories = {'general': []} categories = {'general': []}
for filename in listdir(engine_dir): for filename in listdir(engine_dir):
modname = splitext(filename)[0]
if filename.startswith('_') or not filename.endswith('.py'): if filename.startswith('_') or not filename.endswith('.py'):
continue continue
modname = splitext(filename)[0]
if modname in settings.blacklist:
continue
filepath = join(engine_dir, filename) filepath = join(engine_dir, filename)
engine = load_source(modname, filepath) engine = load_source(modname, filepath)
engine.name = modname engine.name = modname