@@ -44,7 +44,6 @@ def request(query, params):
45 # wrong query
45 # wrong query
46 return params
46 return params
48 amount, from_currency, to_currency = m.groups()
47 amount, from_currency, to_currency = m.groups()
49 amount = float(amount)
48 amount = float(amount)
50 from_currency = name_to_iso4217(from_currency.strip())
49 from_currency = name_to_iso4217(from_currency.strip())
@@ -64,7 +63,7 @@ def request(query, params):
65def response(resp):
64def response(resp):
66 """remove first and last lines to get only json"""
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 results = []
67 results = []
70 conversion_rate = float(json.loads(json_resp)['conversion']['converted-amount'])
69 conversion_rate = float(json.loads(json_resp)['conversion']['converted-amount'])