Browse Source

fix searxng_extra/update/update*.py scripts

call searx.locales.locales_initialize before using LOCALE_NAMES

Related to https://github.com/searxng/searxng/pull/1306
master
Alexandre Flament 1 month ago committed by Markus Heiser
parent
commit
578b2a8183
  1. 3
      searxng_extra/update/update_currencies.py
  2. 3
      searxng_extra/update/update_engine_descriptions.py

3
searxng_extra/update/update_currencies.py

@ -19,10 +19,11 @@ import json
from os.path import join
from searx import searx_dir
from searx.locales import LOCALE_NAMES
from searx.locales import LOCALE_NAMES, locales_initialize
from searx.engines import wikidata, set_loggers
set_loggers(wikidata, 'wikidata')
locales_initialize()
# ORDER BY (with all the query fields) is important to keep a deterministic result order
# so multiple invokation of this script doesn't change currencies.json

3
searxng_extra/update/update_engine_descriptions.py

@ -22,13 +22,14 @@ from langdetect.lang_detect_exception import LangDetectException
from searx.engines import wikidata, set_loggers
from searx.utils import extract_text, match_language
from searx.locales import LOCALE_NAMES
from searx.locales import LOCALE_NAMES, locales_initialize
from searx import searx_dir
from searx.utils import gen_useragent
import searx.search
import searx.network
set_loggers(wikidata, 'wikidata')
locales_initialize()
SPARQL_WIKIPEDIA_ARTICLE = """
SELECT DISTINCT ?item ?name

Loading…
Cancel
Save