mirror of
https://github.com/searxng/searxng.git
synced 2025-08-02 01:52:21 +02:00
[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>
This commit is contained in:
parent
d95c46d646
commit
55b30b5b49
4 changed files with 28 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue