summaryrefslogtreecommitdiff
path: root/searxng_extra/update/update_engine_descriptions.py
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-01-05 19:46:00 +0100
committerGitHub <noreply@github.com>2022-01-05 19:46:00 +0100
commit160f3e022e1774f3a25a9f5e0cf36ec34976cdad (patch)
tree1f935d47da7f89298dc4882cfd875d0dea3e433e /searxng_extra/update/update_engine_descriptions.py
parent9004e84b6e33c0a64fc6f4413734c9bdfdb118f6 (diff)
parent295876abaa93b8dea44dc0beaf8eb2596da69aed (diff)
Merge pull request #683 from return42/fix-doc
Document & Pylint scripts in searxng_extra/update
Diffstat (limited to 'searxng_extra/update/update_engine_descriptions.py')
-rwxr-xr-xsearxng_extra/update/update_engine_descriptions.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/searxng_extra/update/update_engine_descriptions.py b/searxng_extra/update/update_engine_descriptions.py
index 51cfc7cc2..5b73fd396 100755
--- a/searxng_extra/update/update_engine_descriptions.py
+++ b/searxng_extra/update/update_engine_descriptions.py
@@ -1,6 +1,16 @@
#!/usr/bin/env python
+# lint: pylint
# SPDX-License-Identifier: AGPL-3.0-or-later
+"""Fetch website description from websites and from
+:origin:`searx/engines/wikidata.py` engine.
+
+Output file: :origin:`searx/data/engine_descriptions.json`.
+
+"""
+
+# pylint: disable=invalid-name, global-statement
+
import json
from urllib.parse import urlparse
from os.path import join
@@ -102,7 +112,7 @@ def get_wikipedia_summary(lang, pageid):
response.raise_for_status()
api_result = json.loads(response.text)
return api_result.get('extract')
- except:
+ except Exception: # pylint: disable=broad-except
return None
@@ -134,7 +144,7 @@ def get_website_description(url, lang1, lang2=None):
try:
response = searx.network.get(url, headers=headers, timeout=10)
response.raise_for_status()
- except Exception:
+ except Exception: # pylint: disable=broad-except
return (None, None)
try: