diff --git a/clientExample.py b/clientExample.py index d5c6557..cc92133 100755 --- a/clientExample.py +++ b/clientExample.py @@ -46,12 +46,12 @@ def print_out(ws, msg): coinfloor.WatchOrders( base = Assets["XBT"], - counter = Assets["USD"], + counter = Assets["GBP"], watch = True ) coinfloor.WatchTicker( base = Assets["XBT"], - counter = Assets["USD"], + counter = Assets["GBP"], watch = True ) diff --git a/coinfloor.py b/coinfloor.py index db14c90..05259e0 100755 --- a/coinfloor.py +++ b/coinfloor.py @@ -112,7 +112,7 @@ def __init__(self, url, ) - def _open_handler(self, ws): + def _open_handler(self): self.conditional.acquire() self.connected = True self.conditional.notifyAll() @@ -122,14 +122,14 @@ def _open_handler(self, ws): self.open_handler(self) - def _err_handler(self, ws, error): + def _err_handler(self, error): if self.err_handler is not None: self.err_handler(self, error) else: raise ConnectionError("Connection to %s failed: %s"%(self.url, error)) - def _msg_handler(self, ws, message): + def _msg_handler(self, message): if not self.auth_complete: body = json.loads(message) self._body_scan(body) @@ -140,15 +140,15 @@ def _msg_handler(self, ws, message): def _process_welcome_message(self, body): if "nonce" not in body: - self._err_handler(self, "Invalid 'Welcome' message received") + self._err_handler("Invalid 'Welcome' message received") elif self.server_nonce is not None: - self._err_handler(self, "Server nonce received more than once") + self._err_handler("Server nonce received more than once") else: try: self.conditional.acquire() self.server_nonce = base64.b64decode(body["nonce"]) except TypeError: - self._err_handler(self, "Server nonce received is invalid") + self._err_handler("Server nonce received is invalid") finally: self.conditional.notify_all() self.conditional.release() @@ -229,7 +229,7 @@ def _smart_connect(self): lambda: self.connected ) except KeyboardInterrupt: - self._err_handler(self, "Interrupted while establishing the connection") + self._err_handler("Interrupted while establishing the connection") def _wait_for_server_nonce(self): @@ -238,7 +238,7 @@ def _wait_for_server_nonce(self): lambda: self.server_nonce is not None ) except KeyboardInterrupt: - self._err_handler(self, "Interrupted while waiting for server nonce") + self._err_handler("Interrupted while waiting for server nonce") def _wait_for_auth_response(self): @@ -247,7 +247,7 @@ def _wait_for_auth_response(self): lambda: self.auth_complete is True ) except KeyboardInterrupt: - self._err_handler(self, "Interrupted while waiting for authentication to complete") + self._err_handler("Interrupted while waiting for authentication to complete") def _compute_ecdsa_signature(self): @@ -278,7 +278,7 @@ def _compute_ecdsa_signature(self): return r, s except ValueError: - self._err_handler(self, "Invalid signature data") + self._err_handler("Invalid signature data") def _send_signature(self, **sig_data): @@ -290,14 +290,14 @@ def authenticate(self): return if self.user_id is None or self.cookie is None or self.passphrase is None: - self._err_handler(self, "Missing authentication data") + self._err_handler("Missing authentication data") return self._smart_connect() self._wait_for_server_nonce() if self.server_nonce is None: - self._err_handler(self, "Server nonce not received before timeout") + self._err_handler("Server nonce not received before timeout") else: signature = self._compute_ecdsa_signature() @@ -313,9 +313,9 @@ def authenticate(self): self._wait_for_auth_response() if not self.auth_complete: - self._err_handler(self, "Unable to complete authentication") + self._err_handler("Unable to complete authentication") elif not self.auth_okay: - self._err_handler(self, "Authentication failed") + self._err_handler("Authentication failed") def GetBalances(self, **data):