mirror of
https://github.com/searxng/searxng.git
synced 2025-12-23 04:00:02 +00:00
[pylint] add scripts from searxng_extra/update to pylint
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
# lint: pylint
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
"""Fetch website description from websites and from
|
||||
@@ -8,6 +9,8 @@ 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
|
||||
@@ -109,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
|
||||
|
||||
|
||||
@@ -141,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:
|
||||
|
||||
Reference in New Issue
Block a user