summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-06-03 15:41:52 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2022-06-03 15:41:52 +0200
commit2de007138ca1820e865c574cc13429d5da3f019f (patch)
treee51c29aeebc52cd0c2cb3daa45fbfacf396cd778 /searx
parent658e04077b2f647156965610461755682d7cd399 (diff)
downloadsearxng-2de007138ca1820e865c574cc13429d5da3f019f.tar.gz
searxng-2de007138ca1820e865c574cc13429d5da3f019f.zip
[fix] prepare for pylint 2.14.0
Remove issue reported by Pylint 2.14.0: - no-self-use: has been moved to optional extension [1] - The refactoring checker now also raises 'consider-using-generator' messages for max(), min() and sum(). [2] .pylintrc: - <option name>-hint has been removed since long, Pylint 2.14.0 raises an error on invalid options - bad-continuation and bad-whitespace have been removed [3] [1] https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/summary.html#removed-checkers [2] https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/full.html#what-s-new-in-pylint-2-14-0 [2] https://pylint.pycqa.org/en/latest/whatsnew/2/2.6/summary.html#summary-release-highlights Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/wikidata.py2
-rw-r--r--searx/infopage/__init__.py2
-rw-r--r--searx/metrics/__init__.py1
-rw-r--r--searx/network/__init__.py2
-rw-r--r--searx/plugins/__init__.py1
-rw-r--r--searx/plugins/search_on_category_select.py2
-rw-r--r--searx/preferences.py2
-rw-r--r--searx/search/__init__.py2
-rw-r--r--searx/search/processors/abstract.py2
-rw-r--r--searx/utils.py2
-rwxr-xr-xsearx/webapp.py1
11 files changed, 8 insertions, 11 deletions
diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py
index 592a51ec8..b7c318e53 100644
--- a/searx/engines/wikidata.py
+++ b/searx/engines/wikidata.py
@@ -464,7 +464,6 @@ def get_attributes(language):
class WDAttribute:
- # pylint: disable=no-self-use
__slots__ = ('name',)
def __init__(self, name):
@@ -626,7 +625,6 @@ class WDImageAttribute(WDURLAttribute):
class WDDateAttribute(WDAttribute):
- # pylint: disable=no-self-use
def get_select(self):
return '?{name} ?{name}timePrecision ?{name}timeZone ?{name}timeCalendar'.replace('{name}', self.name)
diff --git a/searx/infopage/__init__.py b/searx/infopage/__init__.py
index f8be73f09..4aebfa5a7 100644
--- a/searx/infopage/__init__.py
+++ b/searx/infopage/__init__.py
@@ -81,7 +81,7 @@ class InfoPage:
MarkdownIt("commonmark", {"typographer": True}).enable(["replacements", "smartquotes"]).render(self.content)
)
- def get_ctx(self): # pylint: disable=no-self-use
+ def get_ctx(self):
"""Jinja context to render :py:obj:`InfoPage.content`"""
def _md_link(name, url):
diff --git a/searx/metrics/__init__.py b/searx/metrics/__init__.py
index bc755b96b..18d2170df 100644
--- a/searx/metrics/__init__.py
+++ b/searx/metrics/__init__.py
@@ -160,6 +160,7 @@ def get_reliabilities(engline_name_list, checker_results):
# even if there is no exception
reliablity = 0
else:
+ # pylint: disable=consider-using-generator
reliablity = 100 - sum([error['percentage'] for error in errors if not error.get('secondary')])
reliabilities[engine_name] = {
diff --git a/searx/network/__init__.py b/searx/network/__init__.py
index e8dddd6a0..06c9f75a4 100644
--- a/searx/network/__init__.py
+++ b/searx/network/__init__.py
@@ -13,7 +13,7 @@ from typing import Iterable, Tuple
import httpx
import anyio
-from .network import get_network, initialize, check_network_configuration
+from .network import get_network, initialize, check_network_configuration # pylint:disable=cyclic-import
from .client import get_loop
from .raise_for_httperror import raise_for_httperror
diff --git a/searx/plugins/__init__.py b/searx/plugins/__init__.py
index 3d431f329..8ece94358 100644
--- a/searx/plugins/__init__.py
+++ b/searx/plugins/__init__.py
@@ -198,7 +198,6 @@ class PluginStore:
self.plugins.append(plugin)
def call(self, ordered_plugin_list, plugin_type, *args, **kwargs):
- # pylint: disable=no-self-use
ret = True
for plugin in ordered_plugin_list:
if hasattr(plugin, plugin_type):
diff --git a/searx/plugins/search_on_category_select.py b/searx/plugins/search_on_category_select.py
index 99066e23e..85b73a9bd 100644
--- a/searx/plugins/search_on_category_select.py
+++ b/searx/plugins/search_on_category_select.py
@@ -18,7 +18,7 @@ from flask_babel import gettext
name = gettext('Search on category select')
description = gettext(
- 'Perform search immediately if a category selected. ' 'Disable to select multiple categories. (JavaScript required)'
+ 'Perform search immediately if a category selected. Disable to select multiple categories. (JavaScript required)'
)
default_on = True
preference_section = 'ui'
diff --git a/searx/preferences.py b/searx/preferences.py
index cd943af66..46b7b39d7 100644
--- a/searx/preferences.py
+++ b/searx/preferences.py
@@ -208,11 +208,9 @@ class BooleanChoices:
self.default_choices = dict(choices)
def transform_form_items(self, items):
- # pylint: disable=no-self-use
return items
def transform_values(self, values):
- # pylint: disable=no-self-use
return values
def parse_cookie(self, data_disabled: str, data_enabled: str):
diff --git a/searx/search/__init__.py b/searx/search/__init__.py
index e790bd05e..c517814de 100644
--- a/searx/search/__init__.py
+++ b/searx/search/__init__.py
@@ -133,7 +133,7 @@ class Search:
def search_multiple_requests(self, requests):
# pylint: disable=protected-access
- search_id = uuid4().__str__()
+ search_id = str(uuid4())
for engine_name, query, request_params in requests:
th = threading.Thread( # pylint: disable=invalid-name
diff --git a/searx/search/processors/abstract.py b/searx/search/processors/abstract.py
index b7703496b..d4822fc56 100644
--- a/searx/search/processors/abstract.py
+++ b/searx/search/processors/abstract.py
@@ -170,5 +170,5 @@ class EngineProcessor(ABC):
tests.update(self.get_default_tests())
return tests
- def get_default_tests(self): # pylint: disable=no-self-use
+ def get_default_tests(self):
return {}
diff --git a/searx/utils.py b/searx/utils.py
index abc330be2..15f4d7092 100644
--- a/searx/utils.py
+++ b/searx/utils.py
@@ -464,7 +464,7 @@ def to_string(obj: Any) -> str:
if isinstance(obj, str):
return obj
if hasattr(obj, '__str__'):
- return obj.__str__()
+ return str(obj)
return repr(obj)
diff --git a/searx/webapp.py b/searx/webapp.py
index fa5ca0605..493468a22 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -1048,6 +1048,7 @@ def preferences():
# even if there is no exception
reliablity = 0
else:
+ # pylint: disable=consider-using-generator
reliablity = 100 - sum([error['percentage'] for error in errors if not error.get('secondary')])
reliabilities[e.name] = {