Skip to content

Commit d3ef6a1

Browse files
committed
Fix continuation
1 parent b950961 commit d3ef6a1

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

inoreader/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ def get_subscription_list(self):
110110
for item in resp.json()['subscriptions']:
111111
yield Subscription.from_json(item)
112112

113-
def get_stream_contents(self, stream_id):
114-
c = ''
113+
def get_stream_contents(self, stream_id, c=''):
115114
while True:
116115
articles, c = self.__get_stream_contents(stream_id, c)
117116
for a in articles:
@@ -134,7 +133,10 @@ def __get_stream_contents(self, stream_id, continuation=''):
134133
if resp.status_code != 200:
135134
raise APIError(resp.text)
136135

137-
return resp.json()['items'], resp.json()['continuation']
136+
if 'continuation' in resp.json():
137+
return resp.json()['items'], resp.json()['continuation']
138+
else:
139+
return resp.json()['items'], None
138140

139141
def fetch_unread(self, folder=None, tags=None):
140142
if not self.auth_token:

inoreader/main.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,6 @@ def list_folders():
123123
print("{}\t{}".format(item['unread_count'], item['name']))
124124

125125

126-
def get_subscription_list():
127-
client = get_client()
128-
for item in client.get_subscription_list():
129-
print(item.__dict__)
130-
131-
132-
def get_stream_contents(stream_id):
133-
client = get_client()
134-
for item in client.get_stream_contents(stream_id):
135-
print(item.__dict__)
136-
137-
138126
def add_tags_list_parser(subparsers):
139127
subparsers.add_parser('list-tags', help="List all tags")
140128

0 commit comments

Comments
 (0)