Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Examples to make them run against current API with modern Python. #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clientExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
6 changes: 3 additions & 3 deletions coinfloor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down