.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
__init__.py
Go to the documentation of this file.
1
# SPDX-License-Identifier: AGPL-3.0-or-later
2
"""This module holds the *data* created by::
3
4
make data.all
5
6
"""
7
8
__all__ = [
9
'ENGINE_TRAITS'
,
10
'CURRENCIES'
,
11
'USER_AGENTS'
,
12
'EXTERNAL_URLS'
,
13
'WIKIDATA_UNITS'
,
14
'EXTERNAL_BANGS'
,
15
'OSM_KEYS_TAGS'
,
16
'ENGINE_DESCRIPTIONS'
,
17
'LOCALES'
,
18
'ahmia_blacklist_loader'
,
19
]
20
21
import
json
22
from
pathlib
import
Path
23
24
data_dir = Path(__file__).parent
25
26
27
def
_load
(filename):
28
with
open(data_dir / filename, encoding=
'utf-8'
)
as
f:
29
return
json.load(f)
30
31
32
def
ahmia_blacklist_loader
():
33
"""Load data from `ahmia_blacklist.txt` and return a list of MD5 values of onion
34
names. The MD5 values are fetched by::
35
36
searxng_extra/update/update_ahmia_blacklist.py
37
38
This function is used by :py:mod:`searx.plugins.ahmia_filter`.
39
40
"""
41
with
open(data_dir /
'ahmia_blacklist.txt'
, encoding=
'utf-8'
)
as
f:
42
return
f.read().split()
43
44
45
CURRENCIES =
_load
(
'currencies.json'
)
46
USER_AGENTS =
_load
(
'useragents.json'
)
47
EXTERNAL_URLS =
_load
(
'external_urls.json'
)
48
WIKIDATA_UNITS =
_load
(
'wikidata_units.json'
)
49
EXTERNAL_BANGS =
_load
(
'external_bangs.json'
)
50
OSM_KEYS_TAGS =
_load
(
'osm_keys_tags.json'
)
51
ENGINE_DESCRIPTIONS =
_load
(
'engine_descriptions.json'
)
52
ENGINE_TRAITS =
_load
(
'engine_traits.json'
)
53
LOCALES =
_load
(
'locales.json'
)
searx.data.ahmia_blacklist_loader
ahmia_blacklist_loader()
Definition
__init__.py:32
searx.data._load
_load(filename)
Definition
__init__.py:27
searxng
searx
data
__init__.py
Generated on Sat Nov 16 2024 00:10:57 for .oO SearXNG Developer Documentation Oo. by
1.12.0