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

Chore/upgrade python websocket dependency #542

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions official-ws/python/bitmex_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def __send_command(self, command, args=None):
args = []
self.ws.send(json.dumps({"op": command, "args": args}))

def __on_message(self, message):
def __on_message(self, ws, message):
'''Handler for parsing WS messages.'''
message = json.loads(message)
self.logger.debug(json.dumps(message))
Expand Down Expand Up @@ -240,17 +240,17 @@ def __on_message(self, message):
except:
self.logger.error(traceback.format_exc())

def __on_error(self, error):
def __on_error(self, ws, error):
'''Called on fatal websocket errors. We exit on these.'''
if not self.exited:
self.logger.error("Error : %s" % error)
raise websocket.WebSocketException(error)

def __on_open(self):
def __on_open(self, ws):
'''Called when the WS opens.'''
self.logger.debug("Websocket Opened.")

def __on_close(self):
def __on_close(self, ws, status_code, msg):
'''Called on websocket close.'''
self.logger.info('Websocket Closed')

Expand Down
4 changes: 2 additions & 2 deletions official-ws/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
here = dirname(__file__)

setup(name='bitmex-ws',
version='0.5.0',
version='1.5.0',
description='Sample adapter for connecting to the BitMEX Websocket API.',
long_description=open(join(here, 'README.md')).read(),
author='Samuel Reed',
author_email='[email protected]',
url='',
install_requires=[
'websocket-client==0.53.0',
'websocket-client==1.6.4',
],
packages=['', 'util'],
)