2021-06-04 16:23:30 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2020-10-05 11:50:33 +00:00
|
|
|
import json
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
2021-06-04 16:23:30 +00:00
|
|
|
__all__ = [
|
|
|
|
'ENGINES_LANGUAGES',
|
|
|
|
'CURRENCIES',
|
|
|
|
'USER_AGENTS',
|
|
|
|
'EXTERNAL_URLS',
|
|
|
|
'WIKIDATA_UNITS',
|
|
|
|
'EXTERNAL_BANGS',
|
|
|
|
'OSM_KEYS_TAGS',
|
|
|
|
'ahmia_blacklist_loader',
|
|
|
|
]
|
2020-10-05 11:50:33 +00:00
|
|
|
data_dir = Path(__file__).parent
|
|
|
|
|
|
|
|
|
|
|
|
def load(filename):
|
2021-01-12 08:45:16 +00:00
|
|
|
with open(data_dir / filename, encoding='utf-8') as fd:
|
2020-10-05 11:50:33 +00:00
|
|
|
return json.load(fd)
|
|
|
|
|
|
|
|
|
2020-10-26 19:40:24 +00:00
|
|
|
def ahmia_blacklist_loader():
|
|
|
|
with open(str(data_dir / 'ahmia_blacklist.txt'), encoding='utf-8') as fd:
|
|
|
|
return fd.read().split()
|
|
|
|
|
|
|
|
|
2020-10-05 11:50:33 +00:00
|
|
|
ENGINES_LANGUAGES = load('engines_languages.json')
|
|
|
|
CURRENCIES = load('currencies.json')
|
|
|
|
USER_AGENTS = load('useragents.json')
|
2020-10-26 18:19:18 +00:00
|
|
|
EXTERNAL_URLS = load('external_urls.json')
|
|
|
|
WIKIDATA_UNITS = load('wikidata_units.json')
|
2021-02-22 17:03:24 +00:00
|
|
|
EXTERNAL_BANGS = load('external_bangs.json')
|
2021-06-04 07:35:26 +00:00
|
|
|
OSM_KEYS_TAGS = load('osm_keys_tags.json')
|