summaryrefslogtreecommitdiff
path: root/searx/engines/duckduckgo_definitions.py
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2014-01-20 02:31:20 +0100
committerasciimoo <asciimoo@gmail.com>2014-01-20 02:31:20 +0100
commitb2492c94f422e18cb8954ec983134f4fa5c7cdc0 (patch)
tree969ea30e5dc642d896fa7b744571110ebfe13e7a /searx/engines/duckduckgo_definitions.py
parent692c0bf5f0b353bfbb46aaee1af54afb164dedbc (diff)
downloadsearxng-b2492c94f422e18cb8954ec983134f4fa5c7cdc0.tar.gz
searxng-b2492c94f422e18cb8954ec983134f4fa5c7cdc0.zip
[fix] pep/flake8 compatibility
Diffstat (limited to 'searx/engines/duckduckgo_definitions.py')
-rw-r--r--searx/engines/duckduckgo_definitions.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.py
index 7b3950b85..3037aae53 100644
--- a/searx/engines/duckduckgo_definitions.py
+++ b/searx/engines/duckduckgo_definitions.py
@@ -3,8 +3,9 @@ from urllib import urlencode
url = 'http://api.duckduckgo.com/?{query}&format=json&pretty=0&no_redirect=1'
+
def request(query, params):
- params['url'] = url.format(query=urlencode({'q': query}))
+ params['url'] = url.format(query=urlencode({'q': query}))
return params
@@ -13,11 +14,10 @@ def response(resp):
results = []
if 'Definition' in search_res:
if search_res.get('AbstractURL'):
- res = {'title' : search_res.get('Heading', '')
- ,'content' : search_res.get('Definition', '')
- ,'url' : search_res.get('AbstractURL', '')
- ,'class' : 'definition_result'
- }
+ res = {'title': search_res.get('Heading', ''),
+ 'content': search_res.get('Definition', ''),
+ 'url': search_res.get('AbstractURL', ''),
+ 'class': 'definition_result'}
results.append(res)
return results