SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[fix] issues reported by pylint
Markus Heiserd84226bf6375
diff --git a/searx/engines/bing_images.py b/searx/engines/bing_images.pyindex 246d37a30..73b61b896 100644--- a/searx/engines/bing_images.py+++ b/searx/engines/bing_images.py@@ -6,13 +6,13 @@from urllib.parse import urlencodefrom lxml import htmlfrom json import loads-from searx.utils import match_language+from searx.utils import match_languagefrom searx.engines.bing import language_aliases-from searx.engines.bing import (+from searx.engines.bing import ( # pylint: disable=unused-import_fetch_supported_languages,supported_languages_url,-) # NOQA # pylint: disable=unused-import+)# aboutabout = {@@ -34,7 +34,15 @@ number_of_results = 28# search-urlbase_url = 'https://www.bing.com/'-search_string = 'images/search' '?{query}' '&count={count}' '&first={first}' '&tsc=ImageHoverTitle'+search_string = (+ # fmt: off+ 'images/search'+ '?{query}'+ '&count={count}'+ '&first={first}'+ '&tsc=ImageHoverTitle'+ # fmt: on+)time_range_string = '&qft=+filterui:age-lt{interval}'time_range_dict = {'day': '1440', 'week': '10080', 'month': '43200', 'year': '525600'}diff --git a/searx/engines/bing_videos.py b/searx/engines/bing_videos.pyindex ad61724a1..7f8820546 100644--- a/searx/engines/bing_videos.py+++ b/searx/engines/bing_videos.py@@ -6,15 +6,15 @@from json import loadsfrom lxml import htmlfrom urllib.parse import urlencode-from searx.utils import match_language+from searx.utils import match_languagefrom searx.engines.bing import language_aliases-from searx.engines.bing import (++from searx.engines.bing import ( # pylint: disable=unused-import_fetch_supported_languages,supported_languages_url,-) # NOQA # pylint: disable=unused-import+)-# aboutabout = {"website": 'https://www.bing.com/videos',"wikidata_id": 'Q4914152',@@ -31,7 +31,16 @@ time_range_support = Truenumber_of_results = 28base_url = 'https://www.bing.com/'-search_string = 'videos/search' '?{query}' '&count={count}' '&first={first}' '&scope=video' '&FORM=QBLH'+search_string = (+ # fmt: off+ 'videos/search'+ '?{query}'+ '&count={count}'+ '&first={first}'+ '&scope=video'+ '&FORM=QBLH'+ # fmt: on+)time_range_string = '&qft=+filterui:videoage-lt{interval}'time_range_dict = {'day': '1440', 'week': '10080', 'month': '43200', 'year': '525600'}diff --git a/searx/engines/doku.py b/searx/engines/doku.pyindex e81131cce..08f56bbe7 100644--- a/searx/engines/doku.py+++ b/searx/engines/doku.py@@ -25,9 +25,14 @@ number_of_results = 5# search-url# Doku is OpenSearch compatiblebase_url = 'http://localhost:8090'-search_url = '/?do=search' '&{query}'-# TODO '&startRecord={offset}'\-# TODO '&maximumRecords={limit}'\+search_url = (+ # fmt: off+ '/?do=search'+ '&{query}'+ # fmt: on+)+# TODO '&startRecord={offset}'+# TODO '&maximumRecords={limit}'# do search-requestdiff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.pyindex d4e813c2b..ad3c92169 100644--- a/searx/engines/duckduckgo_definitions.py+++ b/searx/engines/duckduckgo_definitions.py@@ -10,10 +10,10 @@ from lxml import htmlfrom searx.data import WIKIDATA_UNITSfrom searx.engines.duckduckgo import language_aliases-from searx.engines.duckduckgo import (+from searx.engines.duckduckgo import ( # pylint: disable=unused-import_fetch_supported_languages,supported_languages_url,-) # NOQA # pylint: disable=unused-import+)from searx.utils import extract_text, html_to_text, match_language, get_string_replaces_functionfrom searx.external_urls import get_external_url, get_earth_coordinates_url, area_to_osm_zoomdiff --git a/searx/engines/duckduckgo_images.py b/searx/engines/duckduckgo_images.pyindex 21e24d2c9..2f75e16f1 100644--- a/searx/engines/duckduckgo_images.py+++ b/searx/engines/duckduckgo_images.py@@ -7,10 +7,10 @@ from json import loadsfrom urllib.parse import urlencodefrom searx.exceptions import SearxEngineAPIExceptionfrom searx.engines.duckduckgo import get_region_code-from searx.engines.duckduckgo import (+from searx.engines.duckduckgo import ( # pylint: disable=unused-import_fetch_supported_languages,supported_languages_url,-) # NOQA # pylint: disable=unused-import+)from searx.network import get# aboutdiff --git a/searx/engines/etools.py b/searx/engines/etools.pyindex c66ceeb4b..347463291 100644--- a/searx/engines/etools.py+++ b/searx/engines/etools.py@@ -22,7 +22,14 @@ paging = Falsesafesearch = Truebase_url = 'https://www.etools.ch'-search_path = '/searchAdvancedSubmit.do' '?query={search_term}' '&pageResults=20' '&safeSearch={safesearch}'+search_path = (+ # fmt: off+ '/searchAdvancedSubmit.do'+ '?query={search_term}'+ '&pageResults=20'+ '&safeSearch={safesearch}'+ # fmt: on+)def request(query, params):diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.pyindex c8881d299..e5d3f55c0 100644--- a/searx/engines/wikidata.py+++ b/searx/engines/wikidata.py@@ -14,10 +14,10 @@ from searx.data import WIKIDATA_UNITSfrom searx.network import post, getfrom searx.utils import match_language, searx_useragent, get_string_replaces_functionfrom searx.external_urls import get_external_url, get_earth_coordinates_url, area_to_osm_zoom-from searx.engines.wikipedia import (+from searx.engines.wikipedia import ( # pylint: disable=unused-import_fetch_supported_languages,supported_languages_url,-) # NOQA # pylint: disable=unused-import+)# aboutabout = {diff --git a/searx/engines/yahoo_news.py b/searx/engines/yahoo_news.pyindex 06f090f74..00f208b17 100644--- a/searx/engines/yahoo_news.py+++ b/searx/engines/yahoo_news.py@@ -39,7 +39,12 @@ paging = Truecategories = ['news']# search-url-search_url = 'https://news.search.yahoo.com/search' '?{query}&b={offset}'+search_url = (+ # fmt: off+ 'https://news.search.yahoo.com/search'+ '?{query}&b={offset}'+ # fmt: on+)AGO_RE = re.compile(r'([0-9]+)\s*(year|month|week|day|minute|hour)')AGO_TIMEDELTA = {diff --git a/tests/unit/test_webutils.py b/tests/unit/test_webutils.pyindex 8bb3a0447..2b7c6fe5a 100644--- a/tests/unit/test_webutils.py+++ b/tests/unit/test_webutils.py@@ -22,7 +22,7 @@ class TestWebUtils(SearxTestCase):self.assertEqual(webutils.highlight_content('', None), None)self.assertEqual(webutils.highlight_content(False, None), None)- contents = ['<html></html>' 'not<']+ contents = ['<html></html>not<']for content in contents:self.assertEqual(webutils.highlight_content(content, None), content)