[mod] searxng_extras - minor improvements

- fix docs/searxng_extra/standalone_searx.py.rst
- add SPDX tag
- pylint standalone_searx.py and update_wikidata_units.py

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2021-10-03 15:12:09 +02:00 committed by Alexandre Flament
parent 1bb82a6b54
commit 955eab8240
12 changed files with 25 additions and 24 deletions

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python
# SPDX-License-Identifier: AGPL-3.0-or-later
# This script saves Ahmia's blacklist for onion sites.
# More info in https://ahmia.fi/blacklist/

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python
# SPDX-License-Identifier: AGPL-3.0-or-later
import re
import unicodedata

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python
# SPDX-License-Identifier: AGPL-3.0-or-later
import json
from urllib.parse import urlparse

View file

@ -1,5 +1,6 @@
#!/usr/bin/env python
# lint: pylint
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Update searx/data/external_bangs.json using the duckduckgo bangs.

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python
# SPDX-License-Identifier: AGPL-3.0-or-later
import json
import requests
@ -16,7 +17,7 @@ NORMAL_REGEX = re.compile('^[0-9]+\.[0-9](\.[0-9])?$')
# BETA_REGEX = re.compile('.*[0-9]b([0-9\-a-z]+)$')
# ESR_REGEX = re.compile('^[0-9]+\.[0-9](\.[0-9])?esr$')
#
#
useragents = {
"versions": (),
"os": ('Windows NT 10.0; WOW64',

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python
# SPDX-License-Identifier: AGPL-3.0-or-later
# This script generates languages.py from intersecting each engine's supported languages.
#

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python
# lint: pylint
# pylint: disable=missing-function-docstring
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Fetch OSM keys and tags.
To get the i18n names, the scripts uses `Wikidata Query Service`_ instead of for

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Update pygments style

View file

@ -1,4 +1,7 @@
#!/usr/bin/env python
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
# pylint: disable=missing-module-docstring
import json
import collections
@ -51,5 +54,5 @@ def get_wikidata_units_filename():
return join(join(searx_dir, "data"), "wikidata_units.json")
with open(get_wikidata_units_filename(), 'w') as f:
with open(get_wikidata_units_filename(), 'w', encoding="utf8") as f:
json.dump(get_data(), f, indent=4, ensure_ascii=False)