|
@@ -238,6 +238,7 @@ class NotifyApi(object):
|
|
|
Returns a dictionary of tuples of format (status, formatted_msg)
|
|
|
'''
|
|
|
ret = {}
|
|
|
+ i = 0
|
|
|
|
|
|
if len(chan) == 0:
|
|
|
if self.verbose:
|
|
@@ -245,11 +246,10 @@ class NotifyApi(object):
|
|
|
file=sys.stderr)
|
|
|
return ret
|
|
|
|
|
|
- offset = 0
|
|
|
cont = True
|
|
|
while cont:
|
|
|
- payload = {'channel': ','.join(chan), 'limit': LIMIT,
|
|
|
- 'offset': offset}
|
|
|
+ payload = {'channel': ','.join(chan[i*LIMIT:(i+1)*LIMIT]), 'limit': LIMIT,
|
|
|
+ 'offset': 0}
|
|
|
resp = self.access_kraken('/streams', payload)
|
|
|
if resp is None or 'streams' not in resp:
|
|
|
break
|
|
@@ -258,8 +258,8 @@ class NotifyApi(object):
|
|
|
name = stream['channel']['name']
|
|
|
ret[name] = (True, repl(stream, name, self.fmt.user_message['on']))
|
|
|
|
|
|
- offset = offset + LIMIT
|
|
|
- cont = len(resp['streams']) > 0
|
|
|
+ i += 1
|
|
|
+ cont = i*LIMIT < len(chan)
|
|
|
|
|
|
for name in chan:
|
|
|
if name not in ret:
|
|
@@ -277,6 +277,7 @@ class NotifyApi(object):
|
|
|
followed_chans = []
|
|
|
ret = {}
|
|
|
offset = 0
|
|
|
+ i = 0
|
|
|
|
|
|
while True:
|
|
|
fol = self.get_followed_channels({'offset': offset,
|
|
@@ -293,18 +294,17 @@ class NotifyApi(object):
|
|
|
return ret
|
|
|
|
|
|
cmd = '/streams'
|
|
|
- offset = 0
|
|
|
while True:
|
|
|
- payload = {'channel': ','.join(name for name in followed_chans),
|
|
|
- 'offset': offset, 'limit': LIMIT}
|
|
|
+ payload = {'channel': ','.join(followed_chans[i*LIMIT:(i+1)*LIMIT]),
|
|
|
+ 'offset': 0, 'limit': LIMIT}
|
|
|
json = self.access_kraken(cmd, payload)
|
|
|
if json and 'streams' in json:
|
|
|
for stream in json['streams']:
|
|
|
ret[stream['channel']['name']] = (True, stream)
|
|
|
|
|
|
- if not json or (json and 'streams' in json and len(json['streams']) == 0):
|
|
|
+ i += 1
|
|
|
+ if i*LIMIT > len(followed_chans):
|
|
|
break
|
|
|
- offset = offset + LIMIT
|
|
|
|
|
|
for name in followed_chans:
|
|
|
if name not in ret:
|