mirror of https://github.com/searxng/searxng.git
Merge pull request #300 from return42/fix-engine-pylint
[fix] drop useless pylint: disable=undefined-variable
This commit is contained in:
commit
9ef7f38e4f
2
manage
2
manage
|
@ -37,7 +37,7 @@ PYLINT_SEARX_DISABLE_OPTION="\
|
||||||
I,C,R,\
|
I,C,R,\
|
||||||
W0105,W0212,W0511,W0603,W0613,W0621,W0702,W0703,W1401,\
|
W0105,W0212,W0511,W0603,W0613,W0621,W0702,W0703,W1401,\
|
||||||
E1136"
|
E1136"
|
||||||
PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES="supported_languages,language_aliases,logger"
|
PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES="supported_languages,language_aliases,logger,categories"
|
||||||
PYLINT_OPTIONS="-m pylint -j 0 --rcfile .pylintrc"
|
PYLINT_OPTIONS="-m pylint -j 0 --rcfile .pylintrc"
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
|
|
|
@ -64,7 +64,7 @@ def request(query, params):
|
||||||
params['url'] = URL.format(query=urlencode({'q': query}))
|
params['url'] = URL.format(query=urlencode({'q': query}))
|
||||||
language = match_language(
|
language = match_language(
|
||||||
params['language'],
|
params['language'],
|
||||||
supported_languages, # pylint: disable=undefined-variable
|
supported_languages,
|
||||||
language_aliases
|
language_aliases
|
||||||
)
|
)
|
||||||
language = language.split('-')[0]
|
language = language.split('-')[0]
|
||||||
|
|
|
@ -277,7 +277,6 @@ def request(query, params):
|
||||||
offset = (params['pageno'] - 1) * 10
|
offset = (params['pageno'] - 1) * 10
|
||||||
|
|
||||||
lang_info = get_lang_info(
|
lang_info = get_lang_info(
|
||||||
# pylint: disable=undefined-variable
|
|
||||||
params, supported_languages, language_aliases, True
|
params, supported_languages, language_aliases, True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,6 @@ def request(query, params):
|
||||||
"""Google-Video search request"""
|
"""Google-Video search request"""
|
||||||
|
|
||||||
lang_info = get_lang_info(
|
lang_info = get_lang_info(
|
||||||
# pylint: disable=undefined-variable
|
|
||||||
params, supported_languages, language_aliases, False
|
params, supported_languages, language_aliases, False
|
||||||
)
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|
|
@ -75,7 +75,6 @@ def request(query, params):
|
||||||
"""Google-News search request"""
|
"""Google-News search request"""
|
||||||
|
|
||||||
lang_info = get_lang_info(
|
lang_info = get_lang_info(
|
||||||
# pylint: disable=undefined-variable
|
|
||||||
params, supported_languages, language_aliases, False
|
params, supported_languages, language_aliases, False
|
||||||
)
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|
|
@ -73,7 +73,6 @@ def request(query, params):
|
||||||
|
|
||||||
offset = (params['pageno'] - 1) * 10
|
offset = (params['pageno'] - 1) * 10
|
||||||
lang_info = get_lang_info(
|
lang_info = get_lang_info(
|
||||||
# pylint: disable=undefined-variable
|
|
||||||
params, supported_languages, language_aliases, False
|
params, supported_languages, language_aliases, False
|
||||||
)
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|
|
@ -110,7 +110,6 @@ def request(query, params):
|
||||||
"""Google-Video search request"""
|
"""Google-Video search request"""
|
||||||
|
|
||||||
lang_info = get_lang_info(
|
lang_info = get_lang_info(
|
||||||
# pylint: disable=undefined-variable
|
|
||||||
params, supported_languages, language_aliases, False
|
params, supported_languages, language_aliases, False
|
||||||
)
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|
|
@ -34,7 +34,6 @@ def request(query, params):
|
||||||
search_url = sanitized_url + "/api/v1/search/videos/?pageno={pageno}&{query}"
|
search_url = sanitized_url + "/api/v1/search/videos/?pageno={pageno}&{query}"
|
||||||
query_dict = {"search": query}
|
query_dict = {"search": query}
|
||||||
language = params["language"].split("-")[0]
|
language = params["language"].split("-")[0]
|
||||||
# pylint: disable=undefined-variable
|
|
||||||
if "all" != language and language in supported_languages:
|
if "all" != language and language in supported_languages:
|
||||||
query_dict["languageOneOf"] = language
|
query_dict["languageOneOf"] = language
|
||||||
params["url"] = search_url.format(
|
params["url"] = search_url.format(
|
||||||
|
|
|
@ -89,7 +89,6 @@ def request(query, params):
|
||||||
else:
|
else:
|
||||||
language = match_language(
|
language = match_language(
|
||||||
params['language'],
|
params['language'],
|
||||||
# pylint: disable=undefined-variable
|
|
||||||
supported_languages,
|
supported_languages,
|
||||||
language_aliases,
|
language_aliases,
|
||||||
)
|
)
|
||||||
|
|
|
@ -184,7 +184,7 @@ def response(resp):
|
||||||
'''
|
'''
|
||||||
results = []
|
results = []
|
||||||
dom = html.fromstring(resp.text)
|
dom = html.fromstring(resp.text)
|
||||||
is_onion = 'onions' in categories # pylint: disable=undefined-variable
|
is_onion = 'onions' in categories
|
||||||
|
|
||||||
if results_xpath:
|
if results_xpath:
|
||||||
for result in eval_xpath_list(dom, results_xpath):
|
for result in eval_xpath_list(dom, results_xpath):
|
||||||
|
|
Loading…
Reference in New Issue