on master help sign in
[mod] utils/fetch_languages.py: write files at the right location
commit6047087aacdfd3b574c97c6f7f5f25ade683e48e authorAlexandre Flament <alex@al-f.net> dateSun 24 Jan 2021, 14:25 (6 years ago) parent3330cf4
1 file changed+4−3
utils/fetch_languages.py+4−3
utils/fetch_languages.py+4−3
@@ -6,18 +6,19 @@
66# are written in current directory to avoid overwriting in case something goes wrong.
77
88import json
9+from pathlib import Path
910from pprint import pformat
1011from sys import path
1112from babel import Locale, UnknownLocaleError
1213from babel.languages import get_global
1314
1415path.append('../searx') # noqa
15−from searx import settings
16+from searx import settings, searx_dir
1617from searx.engines import initialize_engines, engines
1718
1819# Output files.
19−engines_languages_file = 'engines_languages.json'
20−languages_file = 'languages.py'
20+engines_languages_file = Path(searx_dir) / 'data' / 'engines_languages.json'
21+languages_file = Path(searx_dir) / 'languages.py'
2122
2223
2324# Fetchs supported languages for each engine and writes json file with those.