summaryrefslogtreecommitdiff
path: root/searxng_extra
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-10-03 15:12:09 +0200
committerAlexandre Flament <alex@al-f.net>2021-10-03 19:04:18 +0200
commit955eab8240b4dd903e431b85f6daf35c8672d39c (patch)
treefb7828f8140fba50e20fa4e76be48d219921050b /searxng_extra
parent1bb82a6b54e53d683c3041a1576be64ae234abee (diff)
[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>
Diffstat (limited to 'searxng_extra')
-rw-r--r--searxng_extra/google_search.py2
-rwxr-xr-xsearxng_extra/standalone_searx.py29
-rwxr-xr-xsearxng_extra/update/update_ahmia_blacklist.py1
-rwxr-xr-xsearxng_extra/update/update_currencies.py1
-rwxr-xr-xsearxng_extra/update/update_engine_descriptions.py1
-rwxr-xr-xsearxng_extra/update/update_external_bangs.py1
-rwxr-xr-xsearxng_extra/update/update_firefox_version.py3
-rwxr-xr-xsearxng_extra/update/update_languages.py1
-rwxr-xr-xsearxng_extra/update/update_osm_keys_tags.py2
-rwxr-xr-xsearxng_extra/update/update_pygments.py1
-rwxr-xr-xsearxng_extra/update/update_wikidata_units.py5
11 files changed, 24 insertions, 23 deletions
diff --git a/searxng_extra/google_search.py b/searxng_extra/google_search.py
index cad32eec..34b40c0f 100644
--- a/searxng_extra/google_search.py
+++ b/searxng_extra/google_search.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: AGPL-3.0-or-later
+
from sys import argv, exit
if not len(argv) > 1:
diff --git a/searxng_extra/standalone_searx.py b/searxng_extra/standalone_searx.py
index ae18d7c0..e243d9cb 100755
--- a/searxng_extra/standalone_searx.py
+++ b/searxng_extra/standalone_searx.py
@@ -1,5 +1,11 @@
#!/usr/bin/env python
-"""Script to run searx from terminal.
+# lint: pylint
+
+# SPDX-License-Identifier: AGPL-3.0-or-later
+# (C) Copyright Contributors to the SearXNG project.
+# (C) Copyright Contributors to the searx project (2014 - 2021)
+
+"""Script to run SearXNG from terminal.
Getting categories without initiate the engine will only return `['general']`
@@ -56,25 +62,8 @@ Example to run it from python:
},
"suggestions": [...]
}
-""" # noqa: E501
-# pylint: disable=pointless-string-statement
-'''
-searx is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-searx is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Affero General Public License for more details.
-
-You should have received a copy of the GNU Affero General Public License
-along with searx. If not, see < http://www.gnu.org/licenses/ >.
-
-(C) 2016- by Alexandre Flament, <alex@al-f.net>
-'''
-# pylint: disable=wrong-import-position
+""" # pylint: disable=line-too-long
+
import argparse
import sys
from datetime import datetime
diff --git a/searxng_extra/update/update_ahmia_blacklist.py b/searxng_extra/update/update_ahmia_blacklist.py
index f645880e..f7695dea 100755
--- a/searxng_extra/update/update_ahmia_blacklist.py
+++ b/searxng_extra/update/update_ahmia_blacklist.py
@@ -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/
diff --git a/searxng_extra/update/update_currencies.py b/searxng_extra/update/update_currencies.py
index 06380164..93ac15aa 100755
--- a/searxng_extra/update/update_currencies.py
+++ b/searxng_extra/update/update_currencies.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# SPDX-License-Identifier: AGPL-3.0-or-later
import re
import unicodedata
diff --git a/searxng_extra/update/update_engine_descriptions.py b/searxng_extra/update/update_engine_descriptions.py
index 57646f07..59a9a72a 100755
--- a/searxng_extra/update/update_engine_descriptions.py
+++ b/searxng_extra/update/update_engine_descriptions.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# SPDX-License-Identifier: AGPL-3.0-or-later
import json
from urllib.parse import urlparse
diff --git a/searxng_extra/update/update_external_bangs.py b/searxng_extra/update/update_external_bangs.py
index e6331d47..27882bb2 100755
--- a/searxng_extra/update/update_external_bangs.py
+++ b/searxng_extra/update/update_external_bangs.py
@@ -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.
diff --git a/searxng_extra/update/update_firefox_version.py b/searxng_extra/update/update_firefox_version.py
index 6acfe76c..6a446947 100755
--- a/searxng_extra/update/update_firefox_version.py
+++ b/searxng_extra/update/update_firefox_version.py
@@ -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',
diff --git a/searxng_extra/update/update_languages.py b/searxng_extra/update/update_languages.py
index 3f8a989e..e05dced6 100755
--- a/searxng_extra/update/update_languages.py
+++ b/searxng_extra/update/update_languages.py
@@ -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.
#
diff --git a/searxng_extra/update/update_osm_keys_tags.py b/searxng_extra/update/update_osm_keys_tags.py
index be76dc40..77c715ba 100755
--- a/searxng_extra/update/update_osm_keys_tags.py
+++ b/searxng_extra/update/update_osm_keys_tags.py
@@ -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
diff --git a/searxng_extra/update/update_pygments.py b/searxng_extra/update/update_pygments.py
index a7a238be..3b1c525a 100755
--- a/searxng_extra/update/update_pygments.py
+++ b/searxng_extra/update/update_pygments.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Update pygments style
diff --git a/searxng_extra/update/update_wikidata_units.py b/searxng_extra/update/update_wikidata_units.py
index ddde4c13..43a872b1 100755
--- a/searxng_extra/update/update_wikidata_units.py
+++ b/searxng_extra/update/update_wikidata_units.py
@@ -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)