on master help sign in
Fixed typos.
commit4340c0b16cd6e3375b1867cc9ff02c63d5c4e4fe authorpyrrh0n1c <pyrrh0n1c@protonmail.com> dateTue 7 Nov 2017, 14:14 (9 years ago) parent2231b02
2 files changed+6−6
searx/engines/currency_convert.py+5−5 tests/unit/engines/test_currency_convert.py+1−1
searx/engines/currency_convert.py+5−5
@@ -44,15 +44,15 @@ def request(query, params):
4444 # wrong query
4545 return params
4646
47− ammount, from_currency, to_currency = m.groups()
48− ammount = float(ammount)
47+ amount, from_currency, to_currency = m.groups()
48+ amount = float(amount)
4949 from_currency = name_to_iso4217(from_currency.strip())
5050 to_currency = name_to_iso4217(to_currency.strip())
5151
5252 q = (from_currency + to_currency).upper()
5353
5454 params['url'] = url.format(from_currency, to_currency)
55− params['ammount'] = ammount
55+ params['amount'] = amount
5656 params['from'] = from_currency
5757 params['to'] = to_currency
5858 params['from_name'] = iso4217_to_name(from_currency, 'en')
@@ -73,9 +73,9 @@ def response(resp):
7373 return results
7474
7575 answer = '{0} {1} = {2} {3}, 1 {1} ({5}) = {4} {3} ({6})'.format(
76− resp.search_params['ammount'],
76+ resp.search_params['amount'],
7777 resp.search_params['from'],
78− resp.search_params['ammount'] * conversion_rate,
78+ resp.search_params['amount'] * conversion_rate,
7979 resp.search_params['to'],
8080 conversion_rate,
8181 resp.search_params['from_name'],
tests/unit/engines/test_currency_convert.py+1−1
@@ -23,7 +23,7 @@ class TestCurrencyConvertEngine(SearxTestCase):
2323
2424 def test_response(self):
2525 dicto = defaultdict(dict)
26− dicto['ammount'] = float(10)
26+ dicto['amount'] = float(10)
2727 dicto['from'] = "GBP"
2828 dicto['to'] = "USD"
2929 dicto['from_name'] = "pound sterling"