mirror of
https://github.com/searxng/searxng.git
synced 2025-07-15 01:09:21 +02:00
[format.python] initial formatting of the python code
This patch was generated by black [1]:: make format.python [1] https://github.com/psf/black Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
fcdc2c2cd2
commit
3d96a9839a
184 changed files with 2800 additions and 2836 deletions
|
@ -13,19 +13,21 @@ def request(query, params):
|
|||
params['url'] = search_url
|
||||
params['method'] = 'POST'
|
||||
params['headers']['content-type'] = 'application/json'
|
||||
params['data'] = dumps({
|
||||
"queryString": query,
|
||||
"page": params['pageno'],
|
||||
"pageSize": 10,
|
||||
"sort": "relevance",
|
||||
"useFallbackRankerService": False,
|
||||
"useFallbackSearchCluster": False,
|
||||
"getQuerySuggestions": False,
|
||||
"authors": [],
|
||||
"coAuthors": [],
|
||||
"venues": [],
|
||||
"performTitleMatch": True,
|
||||
})
|
||||
params['data'] = dumps(
|
||||
{
|
||||
"queryString": query,
|
||||
"page": params['pageno'],
|
||||
"pageSize": 10,
|
||||
"sort": "relevance",
|
||||
"useFallbackRankerService": False,
|
||||
"useFallbackSearchCluster": False,
|
||||
"getQuerySuggestions": False,
|
||||
"authors": [],
|
||||
"coAuthors": [],
|
||||
"venues": [],
|
||||
"performTitleMatch": True,
|
||||
}
|
||||
)
|
||||
return params
|
||||
|
||||
|
||||
|
@ -33,10 +35,12 @@ def response(resp):
|
|||
res = loads(resp.text)
|
||||
results = []
|
||||
for result in res['results']:
|
||||
results.append({
|
||||
'url': result['primaryPaperLink']['url'],
|
||||
'title': result['title']['text'],
|
||||
'content': result['paperAbstractTruncated']
|
||||
})
|
||||
results.append(
|
||||
{
|
||||
'url': result['primaryPaperLink']['url'],
|
||||
'title': result['title']['text'],
|
||||
'content': result['paperAbstractTruncated'],
|
||||
}
|
||||
)
|
||||
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue