mirror of https://github.com/searx/searx
[enh] engine blacklist support
This commit is contained in:
parent
1308ebf657
commit
5ee0b7bb80
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue