Skip to content

Commit

Permalink
Don't require usename/password args for socket, fix gzip calls
Browse files Browse the repository at this point in the history
  • Loading branch information
tedivm committed Feb 11, 2018
1 parent aa2b735 commit ee14a2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions screepsapi/screepsapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def activate_ptr(self):

class Socket(object):

def __init__(self, user, password, ptr=False, logging=False, host=None, secure=None, token=None):
def __init__(self, user=None, password=None, ptr=False, logging=False, host=None, secure=None, token=None):
self.settings = {}
self.user = user
self.password = password
Expand All @@ -283,11 +283,11 @@ def on_open(self, ws):
ws.send('auth ' + self.token)
self.token = None

def gzip(enable):
def gzip(self, enable):
if enable:
ws.send('gzip on')
self.ws.send('gzip on')
else:
ws.send('gzip off')
self.ws.send('gzip off')

def subscribe_user(self, watchpoint):
self.subscribe('user:' + self.user_id + '/' + watchpoint)
Expand Down

0 comments on commit ee14a2d

Please sign in to comment.