Browse Source

[mod] make python code pylint 2.16.1 compliant

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Markus Heiser 2 years ago
parent
commit
4c06837a50

+ 1 - 1
.pylintrc

@@ -404,4 +404,4 @@ known-third-party=enchant
 
 # Exceptions that will emit a warning when being caught. Defaults to
 # "Exception"
-overgeneral-exceptions=Exception
+overgeneral-exceptions=builtins.Exception

+ 1 - 0
searx/autocomplete.py

@@ -3,6 +3,7 @@
 """This module implements functions needed for the autocompleter.
 
 """
+# pylint: disable=use-dict-literal
 
 from json import loads
 from urllib.parse import urlencode

+ 1 - 0
searx/engines/crossref.py

@@ -2,6 +2,7 @@
 # lint: pylint
 """Semantic Scholar (Science)
 """
+# pylint: disable=use-dict-literal
 
 from urllib.parse import urlencode
 from searx.utils import html_to_text

+ 1 - 0
searx/engines/docker_hub.py

@@ -3,6 +3,7 @@
 """Docker Hub (IT)
 
 """
+# pylint: disable=use-dict-literal
 
 from json import loads
 from urllib.parse import urlencode

+ 1 - 1
searx/engines/gigablast.py

@@ -3,7 +3,7 @@
 """
  Gigablast (Web)
 """
-# pylint: disable=invalid-name
+# pylint: disable=invalid-name, use-dict-literal
 
 import re
 from time import time

+ 1 - 0
searx/search/processors/online.py

@@ -4,6 +4,7 @@
 """Processores for engine-type: ``online``
 
 """
+# pylint: disable=use-dict-literal
 
 from timeit import default_timer
 import asyncio

+ 2 - 0
searx/webapp.py

@@ -5,6 +5,8 @@
 """WebbApp
 
 """
+# pylint: disable=use-dict-literal
+
 import hashlib
 import hmac
 import json

+ 2 - 0
searxng_extra/update/update_ahmia_blacklist.py

@@ -9,6 +9,7 @@ Output file: :origin:`searx/data/ahmia_blacklist.txt` (:origin:`CI Update data
 .. _Ahmia's blacklist: https://ahmia.fi/blacklist/
 
 """
+# pylint: disable=use-dict-literal
 
 from os.path import join
 
@@ -21,6 +22,7 @@ URL = 'https://ahmia.fi/blacklist/banned/'
 def fetch_ahmia_blacklist():
     resp = requests.get(URL, timeout=3.0)
     if resp.status_code != 200:
+        # pylint: disable=broad-exception-raised
         raise Exception("Error fetching Ahmia blacklist, HTTP code " + resp.status_code)
     return resp.text.split()
 

+ 2 - 1
searxng_extra/update/update_firefox_version.py

@@ -1,13 +1,13 @@
 #!/usr/bin/env python
 # lint: pylint
 # SPDX-License-Identifier: AGPL-3.0-or-later
-
 """Fetch firefox useragent signatures
 
 Output file: :origin:`searx/data/useragents.json` (:origin:`CI Update data ...
 <.github/workflows/data-update.yml>`).
 
 """
+# pylint: disable=use-dict-literal
 
 import json
 import re
@@ -40,6 +40,7 @@ useragents = {
 def fetch_firefox_versions():
     resp = requests.get(URL, timeout=2.0)
     if resp.status_code != 200:
+        # pylint: disable=broad-exception-raised
         raise Exception("Error fetching firefox versions, HTTP code " + resp.status_code)
     dom = html.fromstring(resp.text)
     versions = []