|
|
@ -215,7 +215,12 @@ class Commands(object):
|
|
|
|
|
|
|
|
|
|
|
|
def convert(self, expression, unit=None):
|
|
|
|
def convert(self, expression, unit=None):
|
|
|
|
c = Converter()
|
|
|
|
c = Converter()
|
|
|
|
c.update_currencies(*self.rates.query())
|
|
|
|
try:
|
|
|
|
|
|
|
|
base, rates = self.rates.query()
|
|
|
|
|
|
|
|
except ExchangeRatesError:
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
c.update_currencies(base, rates)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
return c.convert(expression, unit)
|
|
|
|
return c.convert(expression, unit)
|
|
|
|
except ConverterError as e:
|
|
|
|
except ConverterError as e:
|
|
|
|