on master help sign in
[mod] utils/fetch_languages.py: write files at the right location
6047087Alexandre Flament
utils/fetch_languages.py+4−3
@@ -6,18 +6,19 @@
6# are written in current directory to avoid overwriting in case something goes wrong.
6# are written in current directory to avoid overwriting in case something goes wrong.
7
7
8import json
8import json
9+from pathlib import Path
9from pprint import pformat
10from pprint import pformat
10from sys import path
11from sys import path
11from babel import Locale, UnknownLocaleError
12from babel import Locale, UnknownLocaleError
12from babel.languages import get_global
13from babel.languages import get_global
13
14
14path.append('../searx') # noqa
15path.append('../searx') # noqa
15−from searx import settings
16+from searx import settings, searx_dir
16from searx.engines import initialize_engines, engines
17from searx.engines import initialize_engines, engines
17
18
18# Output files.
19# Output files.
19−engines_languages_file = 'engines_languages.json'
20+engines_languages_file = Path(searx_dir) / 'data' / 'engines_languages.json'
20−languages_file = 'languages.py'
21+languages_file = Path(searx_dir) / 'languages.py'
21
22
22
23
23# Fetchs supported languages for each engine and writes json file with those.
24# Fetchs supported languages for each engine and writes json file with those.