|
|
@ -40,16 +40,16 @@ class Exchanger(threading.Thread): |
|
|
|
# 4 = BTC:PLN |
|
|
|
quote_currencies = {} |
|
|
|
try: |
|
|
|
quote_currencies["GBP"] = self.lookup_rate(response, 1) |
|
|
|
quote_currencies["EUR"] = self.lookup_rate(response, 2) |
|
|
|
quote_currencies["USD"] = self.lookup_rate(response, 3) |
|
|
|
quote_currencies["GBP"] = self._lookup_rate(response, 1) |
|
|
|
quote_currencies["EUR"] = self._lookup_rate(response, 2) |
|
|
|
quote_currencies["USD"] = self._lookup_rate(response, 3) |
|
|
|
with self.lock: |
|
|
|
self.quote_currencies = quote_currencies |
|
|
|
self.parent.emit(SIGNAL("refresh_balance()")) |
|
|
|
except KeyError: |
|
|
|
pass |
|
|
|
|
|
|
|
def lookup_rate(self, response, quote_id): |
|
|
|
def _lookup_rate(self, response, quote_id): |
|
|
|
return decimal.Decimal(response[str(quote_id)]["last"]) |
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|