diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2021-07-03 17:51:39 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-07-03 17:54:08 +0200 |
commit | 24f2376c1185dbc0a31ca7d8a777225cf7bea39a (patch) | |
tree | ac83826aaae73b55f444ed9d3c59b8ab5dd63f37 /searx/webapp.py | |
parent | 961dd287a11a2fbac9e11277b4bd5fdca0f4eaa7 (diff) | |
download | searxng-24f2376c1185dbc0a31ca7d8a777225cf7bea39a.tar.gz searxng-24f2376c1185dbc0a31ca7d8a777225cf7bea39a.zip |
[pylint] prepare for pylint v2.9.3 / fix some (new) pylint issues
Upgrade from pylint v2.8.3 to 2.9.3 raise some new issues::
searx/search/checker/__main__.py:37:26: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
searx/search/checker/__main__.py:38:26: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
searx/search/processors/__init__.py:20:0: R0402: Use 'from searx import engines' instead (consider-using-from-import)
searx/preferences.py:182:19: C0207: Use data.split('-', maxsplit=1)[0] instead (use-maxsplit-arg)
searx/preferences.py:506:15: R1733: Unnecessary dictionary index lookup, use 'user_setting' instead (unnecessary-dict-index-lookup)
searx/webapp.py:436:0: C0206: Consider iterating with .items() (consider-using-dict-items)
searx/webapp.py:950:4: C0206: Consider iterating with .items() (consider-using-dict-items)
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-x | searx/webapp.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 6a3562c1c..4d838062b 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -433,6 +433,7 @@ def _get_ordered_categories(): def _get_enable_categories(all_categories): disabled_engines = request.preferences.engines.get_disabled() enabled_categories = set( + # pylint: disable=consider-using-dict-items category for engine_name in engines for category in engines[engine_name].categories if (engine_name, category) not in disabled_engines @@ -947,7 +948,8 @@ def preferences(): ) engines_by_category = {} - for c in categories: + + for c in categories: # pylint: disable=consider-using-dict-items engines_by_category[c] = [e for e in categories[c] if e.name in filtered_engines] # sort the engines alphabetically since the order in settings.yml is meaningless. list.sort(engines_by_category[c], key=lambda e: e.name) |