1
0

currency conversions (bkkcoins)

This commit is contained in:
ThomasV
2013-01-05 15:23:35 +01:00
parent e7e169888d
commit c7edba0990
3 changed files with 41 additions and 6 deletions

View File

@@ -46,9 +46,12 @@ class Exchanger(threading.Thread):
self.parent.emit(SIGNAL("refresh_balance()"))
except KeyError:
pass
def get_currencies(self):
return [] if self.quote_currencies == None else sorted(self.quote_currencies.keys())
def _lookup_rate(self, response, quote_id):
return decimal.Decimal(response[str(quote_id)]["15m"])
return decimal.Decimal(str(response[str(quote_id)]["15m"]))
if __name__ == "__main__":
exch = Exchanger(("BRL", "CNY", "EUR", "GBP", "RUB", "USD"))