Skip to content

Navigation Menu

Sign in
Sign up

Retrieve a specific n page - #16

Open
iwkse wants to merge 2 commits into
MTG:master from
iwkse:master
Open

Retrieve a specific n page #16
iwkse wants to merge 2 commits into
MTG:master from
iwkse:master

Conversation

@iwkse

@iwkse iwkse commented Aug 22, 2016

Copy link
Copy Markdown

def get_page(self, n):
return FSRequest.request(self.next, {‘page’: n}, self.client, Pager)

didn't work for me, but I'd be glad to know if it's my mistake.

Comment thread freesound.py
"""
return FSRequest.request(self.previous, {}, self.client, Pager)
def get_page(self, n):
url = self.next

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail if self.next is None (which could happen if there are no other pages)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 2016年8月29日 08:07:56 -0700
Frederic Font notifications@github.com wrote:

@@ -281,6 +281,23 @@ def previous_page(self):
Get a Pager with the previous results page.
"""
return FSRequest.request(self.previous, {}, self.client, Pager)

  • def get_page(self, n):
  •  url = self.next
    

This will fail if self.next is None (which could happen if there are no other
pages)

True, but it's not going to fail because I do check the boundaries and this is
not called

Salvatore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /