[enh] engine blacklist support

This commit is contained in:
asciimoo 2013-10-19 19:01:06 +02:00
parent 1308ebf657
commit 5ee0b7bb80

View File

@ -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