mirror of
https://github.com/searxng/searxng.git
synced 2024-11-22 19:01:00 +00:00
[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:
parent
1bb82a6b54
commit
955eab8240
12 changed files with 25 additions and 24 deletions
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
.. _standalone_searx.py:
|
.. _standalone_searx.py:
|
||||||
|
|
||||||
===================================
|
=====================================
|
||||||
``searxng_extra/standalone_searx.py``
|
``searxng_extra/standalone_searx.py``
|
||||||
===================================
|
=====================================
|
||||||
|
|
||||||
.. automodule:: searxng_extra.standalone_searx
|
.. automodule:: searxng_extra.standalone_searx
|
||||||
:members:
|
:members:
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
from sys import argv, exit
|
from sys import argv, exit
|
||||||
|
|
||||||
if not len(argv) > 1:
|
if not len(argv) > 1:
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
#!/usr/bin/env python
|
#!/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']`
|
Getting categories without initiate the engine will only return `['general']`
|
||||||
|
|
||||||
|
@ -56,25 +62,8 @@ Example to run it from python:
|
||||||
},
|
},
|
||||||
"suggestions": [...]
|
"suggestions": [...]
|
||||||
}
|
}
|
||||||
""" # noqa: E501
|
""" # pylint: disable=line-too-long
|
||||||
# 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
|
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
# This script saves Ahmia's blacklist for onion sites.
|
# This script saves Ahmia's blacklist for onion sites.
|
||||||
# More info in https://ahmia.fi/blacklist/
|
# More info in https://ahmia.fi/blacklist/
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# lint: pylint
|
# lint: pylint
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
"""
|
"""
|
||||||
Update searx/data/external_bangs.json using the duckduckgo bangs.
|
Update searx/data/external_bangs.json using the duckduckgo bangs.
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import requests
|
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]+)$')
|
# BETA_REGEX = re.compile('.*[0-9]b([0-9\-a-z]+)$')
|
||||||
# ESR_REGEX = re.compile('^[0-9]+\.[0-9](\.[0-9])?esr$')
|
# ESR_REGEX = re.compile('^[0-9]+\.[0-9](\.[0-9])?esr$')
|
||||||
|
|
||||||
#
|
#
|
||||||
useragents = {
|
useragents = {
|
||||||
"versions": (),
|
"versions": (),
|
||||||
"os": ('Windows NT 10.0; WOW64',
|
"os": ('Windows NT 10.0; WOW64',
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
# This script generates languages.py from intersecting each engine's supported languages.
|
# This script generates languages.py from intersecting each engine's supported languages.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# lint: pylint
|
# lint: pylint
|
||||||
# pylint: disable=missing-function-docstring
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
"""Fetch OSM keys and tags.
|
"""Fetch OSM keys and tags.
|
||||||
|
|
||||||
To get the i18n names, the scripts uses `Wikidata Query Service`_ instead of for
|
To get the i18n names, the scripts uses `Wikidata Query Service`_ instead of for
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
"""
|
"""
|
||||||
Update pygments style
|
Update pygments style
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
# lint: pylint
|
||||||
|
# pylint: disable=missing-module-docstring
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import collections
|
import collections
|
||||||
|
@ -51,5 +54,5 @@ def get_wikidata_units_filename():
|
||||||
return join(join(searx_dir, "data"), "wikidata_units.json")
|
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)
|
json.dump(get_data(), f, indent=4, ensure_ascii=False)
|
||||||
|
|
Loading…
Reference in a new issue