1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 12:10:11 +01:00

[mod] utils/fetch_languages.py: write files at the right location

This commit is contained in:
Alexandre Flament 2021-01-24 14:25:27 +01:00
parent 3330cf4a46
commit 6047087aac

View File

@ -6,18 +6,19 @@
# are written in current directory to avoid overwriting in case something goes wrong. # are written in current directory to avoid overwriting in case something goes wrong.
import json import json
from pathlib import Path
from pprint import pformat from pprint import pformat
from sys import path from sys import path
from babel import Locale, UnknownLocaleError from babel import Locale, UnknownLocaleError
from babel.languages import get_global from babel.languages import get_global
path.append('../searx') # noqa path.append('../searx') # noqa
from searx import settings from searx import settings, searx_dir
from searx.engines import initialize_engines, engines from searx.engines import initialize_engines, engines
# Output files. # Output files.
engines_languages_file = 'engines_languages.json' engines_languages_file = Path(searx_dir) / 'data' / 'engines_languages.json'
languages_file = 'languages.py' languages_file = Path(searx_dir) / 'languages.py'
# Fetchs supported languages for each engine and writes json file with those. # Fetchs supported languages for each engine and writes json file with those.