mirror of
https://github.com/searxng/searxng.git
synced 2025-08-18 09:46:44 +02:00
[mod] pylint all engines without PYLINT_SEARXNG_DISABLE_OPTION
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
707d6270c8
commit
8205f170ff
155 changed files with 166 additions and 258 deletions
|
@ -1,12 +1,12 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""BASE (Scholar publications)
|
||||
|
||||
"""
|
||||
BASE (Scholar publications)
|
||||
"""
|
||||
from datetime import datetime
|
||||
import re
|
||||
|
||||
from urllib.parse import urlencode
|
||||
from lxml import etree
|
||||
from datetime import datetime
|
||||
import re
|
||||
from searx.utils import searx_useragent
|
||||
|
||||
# about
|
||||
|
@ -55,13 +55,17 @@ shorcut_dict = {
|
|||
|
||||
def request(query, params):
|
||||
# replace shortcuts with API advanced search keywords
|
||||
for key in shorcut_dict.keys():
|
||||
query = re.sub(key, shorcut_dict[key], query)
|
||||
for key, val in shorcut_dict.items():
|
||||
query = re.sub(key, val, query)
|
||||
|
||||
# basic search
|
||||
offset = (params['pageno'] - 1) * number_of_results
|
||||
|
||||
string_args = dict(query=urlencode({'query': query}), offset=offset, hits=number_of_results)
|
||||
string_args = {
|
||||
'query': urlencode({'query': query}),
|
||||
'offset': offset,
|
||||
'hits': number_of_results,
|
||||
}
|
||||
|
||||
params['url'] = base_url.format(**string_args)
|
||||
|
||||
|
@ -99,7 +103,7 @@ def response(resp):
|
|||
try:
|
||||
publishedDate = datetime.strptime(date, date_format)
|
||||
break
|
||||
except:
|
||||
except: # pylint: disable=bare-except
|
||||
pass
|
||||
|
||||
if publishedDate is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue