diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2024-03-11 07:45:08 +0100 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-03-11 14:55:38 +0100 |
| commit | 8205f170ff983e5240d32dc17d7fdb526ebe5fe7 (patch) | |
| tree | 536acda827bcdd1a6668714855e6f6c3ba6b68d4 /searx/engines/pubmed.py | |
| parent | 707d6270c80426b54aeaa0ac0acd80ded45df533 (diff) | |
[mod] pylint all engines without PYLINT_SEARXNG_DISABLE_OPTION
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/engines/pubmed.py')
| -rw-r--r-- | searx/engines/pubmed.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/searx/engines/pubmed.py b/searx/engines/pubmed.py index b6ffd039f..be934cdc8 100644 --- a/searx/engines/pubmed.py +++ b/searx/engines/pubmed.py @@ -1,11 +1,12 @@ # SPDX-License-Identifier: AGPL-3.0-or-later -""" - PubMed (Scholar publications) +"""PubMed (Scholar publications) + """ -from lxml import etree from datetime import datetime from urllib.parse import urlencode + +from lxml import etree from searx.network import get from searx.utils import ( eval_xpath_getindex, @@ -41,14 +42,18 @@ def request(query, params): # basic search offset = (params['pageno'] - 1) * number_of_results - string_args = dict(query=urlencode({'term': query}), offset=offset, hits=number_of_results) + string_args = { + 'query': urlencode({'term': query}), + 'offset': offset, + 'hits': number_of_results, + } params['url'] = base_url.format(**string_args) return params -def response(resp): +def response(resp): # pylint: disable=too-many-locals results = [] # First retrieve notice of each result @@ -63,7 +68,7 @@ def response(resp): for item in pmids: pmids_string += item.text + ',' - retrieve_notice_args = dict(pmids_string=pmids_string) + retrieve_notice_args = {'pmids_string': pmids_string} retrieve_url_encoded = pubmed_retrieve_api_url.format(**retrieve_notice_args) @@ -119,7 +124,7 @@ def response(resp): '%Y-%m-%d', ) res_dict['publishedDate'] = publishedDate - except Exception as e: + except Exception as e: # pylint: disable=broad-exception-caught print(e) results.append(res_dict) |