diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2024-03-11 14:06:26 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-03-11 14:55:38 +0100 |
commit | 542f7d0d7bd1a12e1884ba4a1508b40e2514d472 (patch) | |
tree | 5256282b267e494200d02914593457854567fec4 /searx/webadapter.py | |
parent | 8205f170ff983e5240d32dc17d7fdb526ebe5fe7 (diff) | |
download | searxng-542f7d0d7bd1a12e1884ba4a1508b40e2514d472.tar.gz searxng-542f7d0d7bd1a12e1884ba4a1508b40e2514d472.zip |
[mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION
In the past, some files were tested with the standard profile, others with a
profile in which most of the messages were switched off ... some files were not
checked at all.
- ``PYLINT_SEARXNG_DISABLE_OPTION`` has been abolished
- the distinction ``# lint: pylint`` is no longer necessary
- the pylint tasks have been reduced from three to two
1. ./searx/engines -> lint engines with additional builtins
2. ./searx ./searxng_extra ./tests -> lint all other python files
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/webadapter.py')
-rw-r--r-- | searx/webadapter.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/searx/webadapter.py b/searx/webadapter.py index 9fbb8ea3e..53d9bfa89 100644 --- a/searx/webadapter.py +++ b/searx/webadapter.py @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +# pylint: disable=missing-module-docstring + from collections import defaultdict from typing import Dict, List, Optional, Tuple from searx.exceptions import SearxParameterException @@ -10,7 +13,7 @@ from searx.utils import detect_language # remove duplicate queries. -# FIXME: does not fix "!music !soundcloud", because the categories are 'none' and 'music' +# HINT: does not fix "!music !soundcloud", because the categories are 'none' and 'music' def deduplicate_engineref_list(engineref_list: List[EngineRef]) -> List[EngineRef]: engineref_dict = {q.category + '|' + q.name: q for q in engineref_list} return list(engineref_dict.values()) @@ -55,7 +58,7 @@ def parse_lang(preferences: Preferences, form: Dict[str, str], raw_text_query: R return preferences.get_value('language') # get language # set specific language if set on request, query or preferences - # TODO support search with multiple languages + # search with multiple languages is not supported (by most engines) if len(raw_text_query.languages): query_lang = raw_text_query.languages[-1] elif 'language' in form: @@ -153,7 +156,10 @@ def get_selected_categories(preferences: Preferences, form: Optional[Dict[str, s return selected_categories -def get_engineref_from_category_list(category_list: List[str], disabled_engines: List[str]) -> List[EngineRef]: +def get_engineref_from_category_list( # pylint: disable=invalid-name + category_list: List[str], + disabled_engines: List[str], +) -> List[EngineRef]: result = [] for categ in category_list: result.extend( @@ -172,7 +178,7 @@ def parse_generic(preferences: Preferences, form: Dict[str, str], disabled_engin explicit_engine_list = False if not is_locked('categories'): # parse the form only if the categories are not locked - for pd_name, pd in form.items(): + for pd_name, pd in form.items(): # pylint: disable=invalid-name if pd_name == 'engines': pd_engines = [ EngineRef(engine_name, engines[engine_name].categories[0]) |