.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
21import json
22from pathlib import Path
23
24data_dir = Path(__file__).parent
25
26
27def _load(filename):
28 with open(data_dir / filename, encoding='utf-8') as f:
29 return json.load(f)
30
31
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
45CURRENCIES = _load('currencies.json')
46USER_AGENTS = _load('useragents.json')
47EXTERNAL_URLS = _load('external_urls.json')
48WIKIDATA_UNITS = _load('wikidata_units.json')
49EXTERNAL_BANGS = _load('external_bangs.json')
50OSM_KEYS_TAGS = _load('osm_keys_tags.json')
51ENGINE_DESCRIPTIONS = _load('engine_descriptions.json')
52ENGINE_TRAITS = _load('engine_traits.json')
53LOCALES = _load('locales.json')
ahmia_blacklist_loader()
Definition __init__.py:32
_load(filename)
Definition __init__.py:27