summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
Diffstat (limited to 'searx')
-rw-r--r--searx/__init__.py2
-rw-r--r--searx/engines/__init__.py2
-rw-r--r--searx/engines/apkmirror.py5
-rw-r--r--searx/engines/artic.py5
-rw-r--r--searx/engines/bing.py3
-rw-r--r--searx/engines/core.py6
-rw-r--r--searx/engines/deviantart.py1
-rw-r--r--searx/engines/digg.py1
-rw-r--r--searx/engines/docker_hub.py1
-rw-r--r--searx/engines/duckduckgo_definitions.py6
-rw-r--r--searx/engines/flickr_noapi.py3
-rw-r--r--searx/engines/genius.py5
-rw-r--r--searx/engines/gigablast.py3
-rw-r--r--searx/engines/google.py6
-rw-r--r--searx/engines/google_images.py4
-rw-r--r--searx/engines/google_news.py6
-rw-r--r--searx/engines/google_scholar.py6
-rw-r--r--searx/engines/google_videos.py6
-rw-r--r--searx/engines/mediathekviewweb.py2
-rw-r--r--searx/engines/meilisearch.py2
-rw-r--r--searx/engines/mongodb.py1
-rw-r--r--searx/engines/mysql_server.py1
-rw-r--r--searx/engines/openstreetmap.py6
-rw-r--r--searx/engines/peertube.py1
-rw-r--r--searx/engines/postgresql.py1
-rw-r--r--searx/engines/qwant.py1
-rw-r--r--searx/engines/redis_server.py1
-rw-r--r--searx/engines/solidtorrents.py5
-rw-r--r--searx/engines/solr.py2
-rw-r--r--searx/engines/soundcloud.py1
-rw-r--r--searx/engines/springer.py5
-rw-r--r--searx/engines/sqlite.py6
-rw-r--r--searx/engines/unsplash.py4
-rw-r--r--searx/engines/wikidata.py3
-rw-r--r--searx/engines/wordnik.py3
-rw-r--r--searx/engines/xpath.py6
-rw-r--r--searx/engines/yahoo_news.py5
-rw-r--r--searx/flaskfix.py2
-rw-r--r--searx/metrics/__init__.py2
-rw-r--r--searx/network/__init__.py2
-rw-r--r--searx/network/client.py2
-rw-r--r--searx/network/network.py2
-rw-r--r--searx/network/raise_for_httperror.py1
-rw-r--r--searx/preferences.py18
-rw-r--r--searx/search/__init__.py2
-rw-r--r--searx/search/checker/__main__.py2
-rw-r--r--searx/search/checker/background.py2
-rw-r--r--searx/search/processors/abstract.py2
-rw-r--r--searx/search/processors/online_currency.py2
-rw-r--r--searx/settings_defaults.py1
-rw-r--r--searx/unixthreadname.py2
-rw-r--r--searx/version.py2
-rwxr-xr-xsearx/webapp.py1
53 files changed, 37 insertions, 135 deletions
diff --git a/searx/__init__.py b/searx/__init__.py
index 0b73d5204..265f926bc 100644
--- a/searx/__init__.py
+++ b/searx/__init__.py
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring, missing-module-docstring
+# pylint: disable=missing-module-docstring
from os.path import dirname, abspath
import logging
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py
index d7defe0b4..154cd605f 100644
--- a/searx/engines/__init__.py
+++ b/searx/engines/__init__.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""This module implements the engine loader.
Load and initialize the ``engines``, see :py:func:`load_engines` and register
@@ -111,6 +110,7 @@ def load_engine(engine_data):
if is_missing_required_attributes(engine):
return None
+ engine.logger = logger.getChild(engine_name)
return engine
diff --git a/searx/engines/apkmirror.py b/searx/engines/apkmirror.py
index 855d19739..746a8cd9c 100644
--- a/searx/engines/apkmirror.py
+++ b/searx/engines/apkmirror.py
@@ -3,20 +3,17 @@
"""APKMirror
"""
-# pylint: disable=invalid-name, missing-function-docstring
+# pylint: disable=invalid-name
from urllib.parse import urlencode
from lxml import html
-from searx import logger
from searx.utils import (
eval_xpath_list,
eval_xpath_getindex,
extract_text,
)
-logger = logger.getChild('APKMirror engine')
-
about = {
"website": 'https://www.apkmirror.com',
"wikidata_id": None,
diff --git a/searx/engines/artic.py b/searx/engines/artic.py
index 44af4ebd5..104ab8839 100644
--- a/searx/engines/artic.py
+++ b/searx/engines/artic.py
@@ -8,14 +8,9 @@ Explore thousands of artworks from The Art Institute of Chicago.
"""
-# pylint: disable=missing-function-docstring
-
from json import loads
from urllib.parse import urlencode
-from searx import logger
-logger = logger.getChild('APKMirror engine')
-
about = {
"website": 'https://www.artic.edu',
"wikidata_id": 'Q239303',
diff --git a/searx/engines/bing.py b/searx/engines/bing.py
index f849cef92..9cac3e926 100644
--- a/searx/engines/bing.py
+++ b/searx/engines/bing.py
@@ -6,11 +6,8 @@
import re
from urllib.parse import urlencode
from lxml import html
-from searx import logger
from searx.utils import eval_xpath, extract_text, match_language
-logger = logger.getChild('bing engine')
-
# about
about = {
"website": 'https://www.bing.com',
diff --git a/searx/engines/core.py b/searx/engines/core.py
index 0d9724695..e83c8bbe9 100644
--- a/searx/engines/core.py
+++ b/searx/engines/core.py
@@ -3,17 +3,13 @@
"""CORE (science)
"""
-# pylint: disable=missing-function-docstring
from json import loads
from datetime import datetime
from urllib.parse import urlencode
-from searx import logger
from searx.exceptions import SearxEngineAPIException
-logger = logger.getChild('CORE engine')
-
about = {
"website": 'https://core.ac.uk',
"wikidata_id": 'Q22661180',
@@ -29,8 +25,6 @@ nb_per_page = 10
api_key = 'unset'
-logger = logger.getChild('CORE engine')
-
base_url = 'https://core.ac.uk:443/api-v2/search/'
search_string = '{query}?page={page}&pageSize={nb_per_page}&apiKey={apikey}'
diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.py
index 21d56831c..b13d54dd5 100644
--- a/searx/engines/deviantart.py
+++ b/searx/engines/deviantart.py
@@ -3,7 +3,6 @@
"""
Deviantart (Images)
"""
-# pylint: disable=missing-function-docstring
from urllib.parse import urlencode
from lxml import html
diff --git a/searx/engines/digg.py b/searx/engines/digg.py
index 5c6fb3875..e12cc43c8 100644
--- a/searx/engines/digg.py
+++ b/searx/engines/digg.py
@@ -3,7 +3,6 @@
"""
Digg (News, Social media)
"""
-# pylint: disable=missing-function-docstring
from json import loads
from urllib.parse import urlencode
diff --git a/searx/engines/docker_hub.py b/searx/engines/docker_hub.py
index d9d0f745b..e69f677b3 100644
--- a/searx/engines/docker_hub.py
+++ b/searx/engines/docker_hub.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""Docker Hub (IT)
"""
diff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.py
index a9098de65..3ef043964 100644
--- a/searx/engines/duckduckgo_definitions.py
+++ b/searx/engines/duckduckgo_definitions.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""DuckDuckGo (Instant Answer API)
"""
@@ -9,15 +8,12 @@ import json
from urllib.parse import urlencode, urlparse, urljoin
from lxml import html
-from searx import logger
from searx.data import WIKIDATA_UNITS
from searx.engines.duckduckgo import language_aliases
from searx.engines.duckduckgo 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_function
from searx.external_urls import get_external_url, get_earth_coordinates_url, area_to_osm_zoom
-logger = logger.getChild('duckduckgo_definitions')
-
# about
about = {
"website": 'https://duckduckgo.com/',
@@ -67,7 +63,7 @@ def request(query, params):
params['url'] = URL.format(query=urlencode({'q': query}))
language = match_language(
params['language'],
- supported_languages, # pylint: disable=undefined-variable
+ supported_languages,
language_aliases
)
language = language.split('-')[0]
diff --git a/searx/engines/flickr_noapi.py b/searx/engines/flickr_noapi.py
index a07aad51e..1d670ee50 100644
--- a/searx/engines/flickr_noapi.py
+++ b/searx/engines/flickr_noapi.py
@@ -7,11 +7,8 @@ from json import loads
from time import time
import re
from urllib.parse import urlencode
-from searx.engines import logger
from searx.utils import ecma_unescape, html_to_text
-logger = logger.getChild('flickr-noapi')
-
# about
about = {
"website": 'https://www.flickr.com',
diff --git a/searx/engines/genius.py b/searx/engines/genius.py
index 9d701a8de..b0fcb09a8 100644
--- a/searx/engines/genius.py
+++ b/searx/engines/genius.py
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=invalid-name, missing-function-docstring
+# pylint: disable=invalid-name
"""Genius
"""
@@ -9,9 +9,6 @@ from json import loads
from urllib.parse import urlencode
from datetime import datetime
-from searx import logger
-logger = logger.getChild('genius engine')
-
# about
about = {
"website": 'https://genius.com/',
diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.py
index d1c2639af..c2c51afe8 100644
--- a/searx/engines/gigablast.py
+++ b/searx/engines/gigablast.py
@@ -3,12 +3,11 @@
"""
Gigablast (Web)
"""
-# pylint: disable=missing-function-docstring, invalid-name
+# pylint: disable=invalid-name
import re
from json import loads
from urllib.parse import urlencode
-# from searx import logger
from searx.network import get
# about
diff --git a/searx/engines/google.py b/searx/engines/google.py
index e1caabb12..4e6fa6190 100644
--- a/searx/engines/google.py
+++ b/searx/engines/google.py
@@ -25,16 +25,11 @@ The google WEB engine itself has a special setup option:
"""
-# pylint: disable=invalid-name, missing-function-docstring
-
from urllib.parse import urlencode
from lxml import html
-from searx import logger
from searx.utils import match_language, extract_text, eval_xpath, eval_xpath_list, eval_xpath_getindex
from searx.exceptions import SearxEngineCaptchaException
-logger = logger.getChild('google engine')
-
# about
about = {
"website": 'https://www.google.com',
@@ -280,7 +275,6 @@ def request(query, params):
offset = (params['pageno'] - 1) * 10
lang_info = get_lang_info(
- # pylint: disable=undefined-variable
params, supported_languages, language_aliases, True
)
diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py
index f4fbbaa42..ffdd6675e 100644
--- a/searx/engines/google_images.py
+++ b/searx/engines/google_images.py
@@ -16,7 +16,6 @@
from urllib.parse import urlencode, unquote
from lxml import html
-from searx import logger
from searx.utils import (
eval_xpath,
eval_xpath_list,
@@ -37,8 +36,6 @@ from searx.engines.google import (
)
# pylint: enable=unused-import
-logger = logger.getChild('google images')
-
# about
about = {
"website": 'https://images.google.com',
@@ -95,7 +92,6 @@ def request(query, params):
"""Google-Video search request"""
lang_info = get_lang_info(
- # pylint: disable=undefined-variable
params, supported_languages, language_aliases, False
)
logger.debug(
diff --git a/searx/engines/google_news.py b/searx/engines/google_news.py
index e6d50855e..87ac9a19d 100644
--- a/searx/engines/google_news.py
+++ b/searx/engines/google_news.py
@@ -11,7 +11,7 @@ ignores some parameters from the common :ref:`google API`:
"""
-# pylint: disable=invalid-name, missing-function-docstring
+# pylint: disable=invalid-name
import binascii
from datetime import datetime
@@ -20,7 +20,6 @@ from urllib.parse import urlencode
from base64 import b64decode
from lxml import html
-from searx import logger
from searx.utils import (
eval_xpath,
eval_xpath_list,
@@ -50,8 +49,6 @@ about = {
"results": 'HTML',
}
-logger = logger.getChild('google news')
-
# compared to other google engines google-news has a different time range
# support. The time range is included in the search term.
time_range_dict = {
@@ -78,7 +75,6 @@ def request(query, params):
"""Google-News search request"""
lang_info = get_lang_info(
- # pylint: disable=undefined-variable
params, supported_languages, language_aliases, False
)
logger.debug(
diff --git a/searx/engines/google_scholar.py b/searx/engines/google_scholar.py
index 8442a7bfa..e6726463d 100644
--- a/searx/engines/google_scholar.py
+++ b/searx/engines/google_scholar.py
@@ -9,12 +9,11 @@ Definitions`_.
https://developers.google.com/custom-search/docs/xml_results#WebSearch_Query_Parameter_Definitions
"""
-# pylint: disable=invalid-name, missing-function-docstring
+# pylint: disable=invalid-name
from urllib.parse import urlencode
from datetime import datetime
from lxml import html
-from searx import logger
from searx.utils import (
eval_xpath,
@@ -53,8 +52,6 @@ use_locale_domain = True
time_range_support = True
safesearch = False
-logger = logger.getChild('google scholar')
-
def time_range_url(params):
"""Returns a URL query component for a google-Scholar time range based on
``params['time_range']``. Google-Scholar does only support ranges in years.
@@ -76,7 +73,6 @@ def request(query, params):
offset = (params['pageno'] - 1) * 10
lang_info = get_lang_info(
- # pylint: disable=undefined-variable
params, supported_languages, language_aliases, False
)
logger.debug(
diff --git a/searx/engines/google_videos.py b/searx/engines/google_videos.py
index 3990d5b32..9403ef4f7 100644
--- a/searx/engines/google_videos.py
+++ b/searx/engines/google_videos.py
@@ -14,13 +14,12 @@
"""
-# pylint: disable=invalid-name, missing-function-docstring
+# pylint: disable=invalid-name
import re
from urllib.parse import urlencode
from lxml import html
-from searx import logger
from searx.utils import (
eval_xpath,
eval_xpath_list,
@@ -59,8 +58,6 @@ about = {
"results": 'HTML',
}
-logger = logger.getChild('google video')
-
# engine dependent config
categories = ['videos']
@@ -113,7 +110,6 @@ def request(query, params):
"""Google-Video search request"""
lang_info = get_lang_info(
- # pylint: disable=undefined-variable
params, supported_languages, language_aliases, False
)
logger.debug(
diff --git a/searx/engines/mediathekviewweb.py b/searx/engines/mediathekviewweb.py
index 80104ae73..bd7c16a5d 100644
--- a/searx/engines/mediathekviewweb.py
+++ b/searx/engines/mediathekviewweb.py
@@ -4,8 +4,6 @@
"""
-# pylint: disable=missing-function-docstring
-
import datetime
from json import loads, dumps
diff --git a/searx/engines/meilisearch.py b/searx/engines/meilisearch.py
index d0d304e2a..c41d23eb4 100644
--- a/searx/engines/meilisearch.py
+++ b/searx/engines/meilisearch.py
@@ -4,7 +4,7 @@
Meilisearch
"""
-# pylint: disable=global-statement, missing-function-docstring
+# pylint: disable=global-statement
from json import loads, dumps
diff --git a/searx/engines/mongodb.py b/searx/engines/mongodb.py
index 1f24c5acf..2ebb90539 100644
--- a/searx/engines/mongodb.py
+++ b/searx/engines/mongodb.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""MongoDB engine (Offline)
"""
diff --git a/searx/engines/mysql_server.py b/searx/engines/mysql_server.py
index 42b436f5e..be89eb86e 100644
--- a/searx/engines/mysql_server.py
+++ b/searx/engines/mysql_server.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""MySQL database (offline)
"""
diff --git a/searx/engines/openstreetmap.py b/searx/engines/openstreetmap.py
index 6920356c3..78c15320a 100644
--- a/searx/engines/openstreetmap.py
+++ b/searx/engines/openstreetmap.py
@@ -3,7 +3,6 @@
"""OpenStreetMap (Map)
"""
-# pylint: disable=missing-function-docstring
import re
from json import loads
@@ -439,3 +438,8 @@ def get_key_label(key_name, lang):
if labels is None:
return None
return get_label(labels, lang)
+
+
+def init(_):
+ import searx.engines.wikidata # pylint: disable=import-outside-toplevel
+ searx.engines.wikidata.logger = logger
diff --git a/searx/engines/peertube.py b/searx/engines/peertube.py
index 058065c03..f9cd50be1 100644
--- a/searx/engines/peertube.py
+++ b/searx/engines/peertube.py
@@ -34,7 +34,6 @@ def request(query, params):
search_url = sanitized_url + "/api/v1/search/videos/?pageno={pageno}&{query}"
query_dict = {"search": query}
language = params["language"].split("-")[0]
- # pylint: disable=undefined-variable
if "all" != language and language in supported_languages:
query_dict["languageOneOf"] = language
params["url"] = search_url.format(
diff --git a/searx/engines/postgresql.py b/searx/engines/postgresql.py
index eb4e9b0b4..1eddcd519 100644
--- a/searx/engines/postgresql.py
+++ b/searx/engines/postgresql.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""PostgreSQL database (offline)
"""
diff --git a/searx/engines/qwant.py b/searx/engines/qwant.py
index 8d03d8324..18e6a65d8 100644
--- a/searx/engines/qwant.py
+++ b/searx/engines/qwant.py
@@ -89,7 +89,6 @@ def request(query, params):
else:
language = match_language(
params['language'],
- # pylint: disable=undefined-variable
supported_languages,
language_aliases,
)
diff --git a/searx/engines/redis_server.py b/searx/engines/redis_server.py
index e8c248e32..a48f0775b 100644
--- a/searx/engines/redis_server.py
+++ b/searx/engines/redis_server.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""Redis engine (offline)
"""
diff --git a/searx/engines/solidtorrents.py b/searx/engines/solidtorrents.py
index 4ed6167d0..7fbef9190 100644
--- a/searx/engines/solidtorrents.py
+++ b/searx/engines/solidtorrents.py
@@ -4,13 +4,8 @@
"""
-# pylint: disable=missing-function-docstring
-
from json import loads
from urllib.parse import urlencode
-from searx import logger
-
-logger = logger.getChild('solidtor engine')
about = {
"website": 'https://www.solidtorrents.net/',
diff --git a/searx/engines/solr.py b/searx/engines/solr.py
index e38a103a9..e26f19442 100644
--- a/searx/engines/solr.py
+++ b/searx/engines/solr.py
@@ -4,7 +4,7 @@
Solr
"""
-# pylint: disable=global-statement, missing-function-docstring
+# pylint: disable=global-statement
from json import loads
from urllib.parse import urlencode
diff --git a/searx/engines/soundcloud.py b/searx/engines/soundcloud.py
index a6f923855..d5bfc0f6f 100644
--- a/searx/engines/soundcloud.py
+++ b/searx/engines/soundcloud.py
@@ -8,7 +8,6 @@ from json import loads
from lxml import html
from dateutil import parser
from urllib.parse import quote_plus, urlencode
-from searx import logger
from searx.network import get as http_get
# about
diff --git a/searx/engines/springer.py b/searx/engines/springer.py
index 77a82016b..246e59b44 100644
--- a/searx/engines/springer.py
+++ b/searx/engines/springer.py
@@ -4,17 +4,12 @@
"""
-# pylint: disable=missing-function-docstring
-
from datetime import datetime
from json import loads
from urllib.parse import urlencode
-from searx import logger
from searx.exceptions import SearxEngineAPIException
-logger = logger.getChild('Springer Nature engine')
-
about = {
"website": 'https://www.springernature.com/',
"wikidata_id": 'Q21096327',
diff --git a/searx/engines/sqlite.py b/searx/engines/sqlite.py
index 84db74d62..292448602 100644
--- a/searx/engines/sqlite.py
+++ b/searx/engines/sqlite.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""SQLite database (Offline)
@@ -9,11 +8,6 @@
import sqlite3
import contextlib
-from searx import logger
-
-
-logger = logger.getChild('SQLite engine')
-
engine_type = 'offline'
database = ""
query_str = ""
diff --git a/searx/engines/unsplash.py b/searx/engines/unsplash.py
index 834bc917c..1445b4cec 100644
--- a/searx/engines/unsplash.py
+++ b/searx/engines/unsplash.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""Unsplash
"""
@@ -8,9 +7,6 @@
from urllib.parse import urlencode, urlparse, urlunparse, parse_qsl
from json import loads
-from searx import logger
-
-logger = logger.getChild('unsplash engine')
# about
about = {
"website": 'https://unsplash.com',
diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py
index ddcce9085..f0dfc7595 100644
--- a/searx/engines/wikidata.py
+++ b/searx/engines/wikidata.py
@@ -10,15 +10,12 @@ from json import loads
from dateutil.parser import isoparse
from babel.dates import format_datetime, format_date, format_time, get_datetime_format
-from searx import logger
from searx.data import WIKIDATA_UNITS
from searx.network import post, get
from searx.utils import match_language, searx_useragent, get_string_replaces_function
from searx.external_urls import get_external_url, get_earth_coordinates_url, area_to_osm_zoom
from searx.engines.wikipedia import _fetch_supported_languages, supported_languages_url # NOQA # pylint: disable=unused-import
-logger = logger.getChild('wikidata')
-
# about
about = {
"website": 'https://wikidata.org/',
diff --git a/searx/engines/wordnik.py b/searx/engines/wordnik.py
index 4bfeb4070..0c3785cfb 100644
--- a/searx/engines/wordnik.py
+++ b/searx/engines/wordnik.py
@@ -4,12 +4,9 @@
"""
from lxml.html import fromstring
-from searx import logger
from searx.utils import extract_text
from searx.network import raise_for_httperror
-logger = logger.getChild('Wordnik engine')
-
# about
about = {
"website": 'https://www.wordnik.com',
diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py
index 0f88fb29a..8338d5301 100644
--- a/searx/engines/xpath.py
+++ b/searx/engines/xpath.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""The XPath engine is a *generic* engine with which it is possible to configure
engines in the settings.
@@ -23,9 +22,6 @@ from urllib.parse import urlencode
from lxml import html
from searx.utils import extract_text, extract_url, eval_xpath, eval_xpath_list
-from searx import logger
-
-logger = logger.getChild('XPath engine')
search_url = None
"""
@@ -187,7 +183,7 @@ def response(resp):
'''
results = []
dom = html.fromstring(resp.text)
- is_onion = 'onions' in categories # pylint: disable=undefined-variable
+ is_onion = 'onions' in categories
if results_xpath:
for result in eval_xpath_list(dom, results_xpath):
diff --git a/searx/engines/yahoo_news.py b/searx/engines/yahoo_news.py
index 98d8bc9f1..ec07cd408 100644
--- a/searx/engines/yahoo_news.py
+++ b/searx/engines/yahoo_news.py
@@ -6,7 +6,7 @@ Yahoo News is "English only" and do not offer localized nor language queries.
"""
-# pylint: disable=invalid-name, missing-function-docstring
+# pylint: disable=invalid-name
import re
from urllib.parse import urlencode
@@ -14,7 +14,6 @@ from datetime import datetime, timedelta
from dateutil import parser
from lxml import html
-from searx import logger
from searx.utils import (
eval_xpath_list,
eval_xpath_getindex,
@@ -23,8 +22,6 @@ from searx.utils import (
from searx.engines.yahoo import parse_url
-logger = logger.getChild('yahoo_news engine')
-
# about
about = {
"website": 'https://news.yahoo.com',
diff --git a/searx/flaskfix.py b/searx/flaskfix.py
index c069df453..47aabfa53 100644
--- a/searx/flaskfix.py
+++ b/searx/flaskfix.py
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-module-docstring,missing-function-docstring
+# pylint: disable=missing-module-docstring
from urllib.parse import urlparse
diff --git a/searx/metrics/__init__.py b/searx/metrics/__init__.py
index 2ef73149b..995f182af 100644
--- a/searx/metrics/__init__.py
+++ b/searx/metrics/__init__.py
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-module-docstring, missing-function-docstring
+# pylint: disable=missing-module-docstring
import typing
import math
diff --git a/searx/network/__init__.py b/searx/network/__init__.py
index 3dc99da48..7b0396a12 100644
--- a/searx/network/__init__.py
+++ b/searx/network/__init__.py
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-module-docstring, missing-function-docstring, global-statement
+# pylint: disable=missing-module-docstring, global-statement
import asyncio
import threading
diff --git a/searx/network/client.py b/searx/network/client.py
index 60171e6c3..187ae5366 100644
--- a/searx/network/client.py
+++ b/searx/network/client.py
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-module-docstring, missing-function-docstring, global-statement
+# pylint: disable=missing-module-docstring, global-statement
import asyncio
import logging
diff --git a/searx/network/network.py b/searx/network/network.py
index 94e91593d..d09a2ee0e 100644
--- a/searx/network/network.py
+++ b/searx/network/network.py
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
# pylint: disable=global-statement
-# pylint: disable=missing-module-docstring, missing-class-docstring, missing-function-docstring
+# pylint: disable=missing-module-docstring, missing-class-docstring
import atexit
import asyncio
diff --git a/searx/network/raise_for_httperror.py b/searx/network/raise_for_httperror.py
index 0f550918d..a2f554614 100644
--- a/searx/network/raise_for_httperror.py
+++ b/searx/network/raise_for_httperror.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""Raise exception for an HTTP response is an error.
"""
diff --git a/searx/preferences.py b/searx/preferences.py
index c19a11f4b..26506556a 100644
--- a/searx/preferences.py
+++ b/searx/preferences.py
@@ -117,7 +117,7 @@ class MultipleChoiceSetting(EnumStringSetting):
self._validate_selections(elements)
self.value = elements
- def parse_form(self, data): # pylint: disable=missing-function-docstring
+ def parse_form(self, data):
if self.locked:
return
@@ -154,7 +154,7 @@ class SetSetting(Setting):
for element in elements:
self.values.add(element)
- def parse_form(self, data): # pylint: disable=missing-function-docstring
+ def parse_form(self, data):
if self.locked:
return
@@ -226,22 +226,22 @@ class SwitchableSetting(Setting):
if not hasattr(self, 'choices'):
raise MissingArgumentException('missing argument: choices')
- def transform_form_items(self, items): # pylint: disable=missing-function-docstring
+ def transform_form_items(self, items):
# pylint: disable=no-self-use
return items
- def transform_values(self, values): # pylint: disable=missing-function-docstring
+ def transform_values(self, values):
# pylint: disable=no-self-use
return values
- def parse_cookie(self, data): # pylint: disable=missing-function-docstring
+ def parse_cookie(self, data):
# pylint: disable=attribute-defined-outside-init
if data[DISABLED] != '':
self.disabled = set(data[DISABLED].split(','))
if data[ENABLED] != '':
self.enabled = set(data[ENABLED].split(','))
- def parse_form(self, items): # pylint: disable=missing-function-docstring
+ def parse_form(self, items):
if self.locked:
return
@@ -262,14 +262,14 @@ class SwitchableSetting(Setting):
resp.set_cookie('disabled_{0}'.format(self.value), ','.join(self.disabled), max_age=COOKIE_MAX_AGE)
resp.set_cookie('enabled_{0}'.format(self.value), ','.join(self.enabled), max_age=COOKIE_MAX_AGE)
- def get_disabled(self): # pylint: disable=missing-function-docstring
+ def get_disabled(self):
disabled = self.disabled
for choice in self.choices: # pylint: disable=no-member
if not choice['default_on'] and choice['id'] not in self.enabled:
disabled.add(choice['id'])
return self.transform_values(disabled)
- def get_enabled(self): # pylint: disable=missing-function-docstring
+ def get_enabled(self):
enabled = self.enabled
for choice in self.choices: # pylint: disable=no-member
if choice['default_on'] and choice['id'] not in self.disabled:
@@ -515,7 +515,7 @@ class Preferences:
resp.set_cookie(k, v, max_age=COOKIE_MAX_AGE)
return resp
- def validate_token(self, engine): # pylint: disable=missing-function-docstring
+ def validate_token(self, engine):
valid = True
if hasattr(engine, 'tokens') and engine.tokens:
valid = False
diff --git a/searx/search/__init__.py b/searx/search/__init__.py
index 041a54c4b..d8d3e1e1c 100644
--- a/searx/search/__init__.py
+++ b/searx/search/__init__.py
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-module-docstring, missing-function-docstring
+# pylint: disable=missing-module-docstring
import typing
import threading
diff --git a/searx/search/checker/__main__.py b/searx/search/checker/__main__.py
index e1de860b7..4ce4ca76b 100644
--- a/searx/search/checker/__main__.py
+++ b/searx/search/checker/__main__.py
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-module-docstring, missing-function-docstring
+# pylint: disable=missing-module-docstring
import sys
import io
diff --git a/searx/search/checker/background.py b/searx/search/checker/background.py
index f79a5d2df..d9f11a71c 100644
--- a/searx/search/checker/background.py
+++ b/searx/search/checker/background.py
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-module-docstring, missing-function-docstring
+# pylint: disable=missing-module-docstring
import json
import random
diff --git a/searx/search/processors/abstract.py b/searx/search/processors/abstract.py
index 81724f052..c8d81c026 100644
--- a/searx/search/processors/abstract.py
+++ b/searx/search/processors/abstract.py
@@ -19,8 +19,6 @@ from searx.utils import get_engine_from_settings
logger = logger.getChild('searx.search.processor')
SUSPENDED_STATUS = {}
-# pylint: disable=missing-function-docstring
-
class SuspendedStatus:
"""Class to handle suspend state."""
diff --git a/searx/search/processors/online_currency.py b/searx/search/processors/online_currency.py
index 4f642fa72..3213a11e5 100644
--- a/searx/search/processors/online_currency.py
+++ b/searx/search/processors/online_currency.py
@@ -12,8 +12,6 @@ from .online import OnlineProcessor
parser_re = re.compile('.*?(\\d+(?:\\.\\d+)?) ([^.0-9]+) (?:in|to) ([^.0-9]+)', re.I)
-# pylint: disable=missing-function-docstring
-
def normalize_name(name):
name = name.lower().replace('-', ' ').rstrip('s')
name = re.sub(' +', ' ', name)
diff --git a/searx/settings_defaults.py b/searx/settings_defaults.py
index 42d88f2bc..62625b912 100644
--- a/searx/settings_defaults.py
+++ b/searx/settings_defaults.py
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""Implementation of the default settings.
"""
diff --git a/searx/unixthreadname.py b/searx/unixthreadname.py
index 9a6f53813..0f1f54936 100644
--- a/searx/unixthreadname.py
+++ b/searx/unixthreadname.py
@@ -14,7 +14,7 @@ else:
old_thread_init = threading.Thread.__init__
def new_thread_init(self, *args, **kwargs):
- # pylint: disable=protected-access, disable=c-extension-no-member, disable=missing-function-docstring
+ # pylint: disable=protected-access, disable=c-extension-no-member
old_thread_init(self, *args, **kwargs)
setproctitle.setthreadtitle(self._name)
threading.Thread.__init__ = new_thread_init
diff --git a/searx/version.py b/searx/version.py
index daada6020..ac42834d9 100644
--- a/searx/version.py
+++ b/searx/version.py
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring,missing-module-docstring,missing-class-docstring
+# pylint: disable=,missing-module-docstring,missing-class-docstring
import re
import os
diff --git a/searx/webapp.py b/searx/webapp.py
index e29b7f442..6fcf7c464 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -1,7 +1,6 @@
#!/usr/bin/env python
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
-# pylint: disable=missing-function-docstring
"""WebbApp
"""