Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pagination generator with non-default per_page #405

Closed
@ericfrederich

Description

@ericfrederich

Currently if you request `xxx.list(as_list=False, per_page=100) you end up getting a list instead of the generator.

I think the logic in inhttp_list needs some rework.
Perhaps just removing the'per_page' in kwargs conditionfrom here

I should be able to specify something like...

my_generator=gl.projects.list(per_page=100,as_list=False)

... and still get a generator. Then I can hook it up to a progress bar like:

my_generator=gl.projects.list(per_page=100,as_list=False,membership=True)withclick.progressbar(my_generator,length=my_generator.total,label='Projects')asbar:forprojectinbar:pass

The above code generates the following error:

AttributeError: 'list' object has no attribute 'total'

Today if I want to use the generator function I have to leave theper_page off and get them only 20 at a time; this makes it much slower.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp