|
@@ -44,7 +44,6 @@ def request(query, params):
|
44
|
44
|
if not m:
|
45
|
45
|
# wrong query
|
46
|
46
|
return params
|
47
|
|
-
|
48
|
47
|
amount, from_currency, to_currency = m.groups()
|
49
|
48
|
amount = float(amount)
|
50
|
49
|
from_currency = name_to_iso4217(from_currency.strip())
|
|
@@ -64,7 +63,7 @@ def request(query, params):
|
64
|
63
|
|
65
|
64
|
def response(resp):
|
66
|
65
|
"""remove first and last lines to get only json"""
|
67
|
|
- json_resp = resp.text[resp.text.find('\n')+1:resp.text.rfind('\n')-2]
|
|
66
|
+ json_resp = resp.text[resp.text.find('\n') + 1:resp.text.rfind('\n') - 2]
|
68
|
67
|
results = []
|
69
|
68
|
try:
|
70
|
69
|
conversion_rate = float(json.loads(json_resp)['conversion']['converted-amount'])
|