diff options
| author | Markus Heiser <markus.heiser@darmarIT.de> | 2021-09-19 09:10:02 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-19 11:10:02 +0200 |
| commit | 55b30b5b494a59c62e9e7d1a5cb6fdbf8729f64f (patch) | |
| tree | 989edd788cfa24e033a42e29f7aa802f4206cd03 /searx_extra/update/update_currencies.py | |
| parent | d95c46d64617edddbb36a7f764e1affaafa551fc (diff) | |
[fix] searx_extra/update scripts: set_loggers(wikidata, 'wikidata') (#331)
* [fix] searx_extra/update scripts: set_loggers(wikidata, 'wikidata')
To test use::
./manage pyenv.cmd searx_extra/update/update_currencies.py
./manage pyenv.cmd searx_extra/update/update_osm_keys_tags.py
./manage pyenv.cmd searx_extra/update/update_wikidata_units.py
The script `update_engine_descriptions.py` seems to have some issues not related
to this patch.
./manage pyenv.cmd python -m pip install -U pycld3
./manage pyenv.cmd searx_extra/update/update_engine_descriptions.py
Closes: https://github.com/searxng/searxng/issues/328
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx_extra/update/update_currencies.py')
| -rwxr-xr-x | searx_extra/update/update_currencies.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/searx_extra/update/update_currencies.py b/searx_extra/update/update_currencies.py index a572f4e9d..063801645 100755 --- a/searx_extra/update/update_currencies.py +++ b/searx_extra/update/update_currencies.py @@ -10,8 +10,9 @@ from os.path import realpath, dirname, join from searx import searx_dir from searx.locales import LOCALE_NAMES -from searx.engines.wikidata import send_wikidata_query +from searx.engines import wikidata, set_loggers +set_loggers(wikidata, 'wikidata') # 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 @@ -83,7 +84,9 @@ def add_currency_label(db, label, iso4217, language): def wikidata_request_result_iterator(request): - result = send_wikidata_query(request.replace('%LANGUAGES_SPARQL%', LANGUAGES_SPARQL)) + result = wikidata.send_wikidata_query( + request.replace('%LANGUAGES_SPARQL%', LANGUAGES_SPARQL) + ) if result is not None: for r in result['results']['bindings']: yield r |