Browse Source

Fixed typos.

pyrrh0n1c 7 years ago
parent
commit
4340c0b16c

+ 5
- 5
searx/engines/currency_convert.py View File

44
         # wrong query
44
         # wrong query
45
         return params
45
         return params
46
 
46
 
47
-    ammount, from_currency, to_currency = m.groups()
48
-    ammount = float(ammount)
47
+    amount, from_currency, to_currency = m.groups()
48
+    amount = float(amount)
49
     from_currency = name_to_iso4217(from_currency.strip())
49
     from_currency = name_to_iso4217(from_currency.strip())
50
     to_currency = name_to_iso4217(to_currency.strip())
50
     to_currency = name_to_iso4217(to_currency.strip())
51
 
51
 
52
     q = (from_currency + to_currency).upper()
52
     q = (from_currency + to_currency).upper()
53
 
53
 
54
     params['url'] = url.format(from_currency, to_currency)
54
     params['url'] = url.format(from_currency, to_currency)
55
-    params['ammount'] = ammount
55
+    params['amount'] = amount
56
     params['from'] = from_currency
56
     params['from'] = from_currency
57
     params['to'] = to_currency
57
     params['to'] = to_currency
58
     params['from_name'] = iso4217_to_name(from_currency, 'en')
58
     params['from_name'] = iso4217_to_name(from_currency, 'en')
73
         return results
73
         return results
74
 
74
 
75
     answer = '{0} {1} = {2} {3}, 1 {1} ({5}) = {4} {3} ({6})'.format(
75
     answer = '{0} {1} = {2} {3}, 1 {1} ({5}) = {4} {3} ({6})'.format(
76
-        resp.search_params['ammount'],
76
+        resp.search_params['amount'],
77
         resp.search_params['from'],
77
         resp.search_params['from'],
78
-        resp.search_params['ammount'] * conversion_rate,
78
+        resp.search_params['amount'] * conversion_rate,
79
         resp.search_params['to'],
79
         resp.search_params['to'],
80
         conversion_rate,
80
         conversion_rate,
81
         resp.search_params['from_name'],
81
         resp.search_params['from_name'],

+ 1
- 1
tests/unit/engines/test_currency_convert.py View File

23
 
23
 
24
     def test_response(self):
24
     def test_response(self):
25
         dicto = defaultdict(dict)
25
         dicto = defaultdict(dict)
26
-        dicto['ammount'] = float(10)
26
+        dicto['amount'] = float(10)
27
         dicto['from'] = "GBP"
27
         dicto['from'] = "GBP"
28
         dicto['to'] = "USD"
28
         dicto['to'] = "USD"
29
         dicto['from_name'] = "pound sterling"
29
         dicto['from_name'] = "pound sterling"