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
|
@ -28,24 +28,25 @@ def request(query, params):
|
|||
key_form = '&key=' + api_key
|
||||
else:
|
||||
key_form = ''
|
||||
params['url'] = url.format(from_lang=params['from_lang'][1],
|
||||
to_lang=params['to_lang'][1],
|
||||
query=params['query'],
|
||||
key=key_form)
|
||||
params['url'] = url.format(
|
||||
from_lang=params['from_lang'][1], to_lang=params['to_lang'][1], query=params['query'], key=key_form
|
||||
)
|
||||
return params
|
||||
|
||||
|
||||
def response(resp):
|
||||
results = []
|
||||
results.append({
|
||||
'url': web_url.format(
|
||||
from_lang=resp.search_params['from_lang'][2],
|
||||
to_lang=resp.search_params['to_lang'][2],
|
||||
query=resp.search_params['query']),
|
||||
'title': '[{0}-{1}] {2}'.format(
|
||||
resp.search_params['from_lang'][1],
|
||||
resp.search_params['to_lang'][1],
|
||||
resp.search_params['query']),
|
||||
'content': resp.json()['responseData']['translatedText']
|
||||
})
|
||||
results.append(
|
||||
{
|
||||
'url': web_url.format(
|
||||
from_lang=resp.search_params['from_lang'][2],
|
||||
to_lang=resp.search_params['to_lang'][2],
|
||||
query=resp.search_params['query'],
|
||||
),
|
||||
'title': '[{0}-{1}] {2}'.format(
|
||||
resp.search_params['from_lang'][1], resp.search_params['to_lang'][1], resp.search_params['query']
|
||||
),
|
||||
'content': resp.json()['responseData']['translatedText'],
|
||||
}
|
||||
)
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue