summaryrefslogtreecommitdiff
path: root/searx/engines/mediawiki.py
diff options
context:
space:
mode:
authorThomas Pointhuber <thomas.pointhuber@gmx.at>2014-12-16 17:10:20 +0100
committerThomas Pointhuber <thomas.pointhuber@gmx.at>2014-12-16 17:10:20 +0100
commit91f9973227e003604e036278e42a4c6394bf5478 (patch)
treeb5dd64a8df5c194e61c435035cddbd3a76c3696a /searx/engines/mediawiki.py
parent672f1c674ca63b7589c1bc6b0c32caf439bd16db (diff)
downloadsearxng-91f9973227e003604e036278e42a4c6394bf5478.tar.gz
searxng-91f9973227e003604e036278e42a4c6394bf5478.zip
[fix] pep8
Diffstat (limited to 'searx/engines/mediawiki.py')
-rw-r--r--searx/engines/mediawiki.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.py
index 4a8b0e8b8..8ca32c62a 100644
--- a/searx/engines/mediawiki.py
+++ b/searx/engines/mediawiki.py
@@ -28,15 +28,17 @@ search_url = base_url + 'w/api.php?action=query'\
'&srprop=timestamp'\
'&format=json'\
'&sroffset={offset}'\
- '&srlimit={limit}'
+ '&srlimit={limit}' # noqa
# do search-request
def request(query, params):
offset = (params['pageno'] - 1) * number_of_results
+
string_args = dict(query=urlencode({'srsearch': query}),
- offset=offset,
- limit=number_of_results)
+ offset=offset,
+ limit=number_of_results)
+
format_strings = list(Formatter().parse(base_url))
if params['language'] == 'all':
@@ -67,7 +69,8 @@ def response(resp):
# parse results
for result in search_results['query']['search']:
- url = base_url.format(language=resp.search_params['language']) + 'wiki/' + quote(result['title'].replace(' ', '_').encode('utf-8'))
+ url = base_url.format(language=resp.search_params['language']) +\
+ 'wiki/' + quote(result['title'].replace(' ', '_').encode('utf-8'))
# append result
results.append({'url': url,