forked from pallets/click
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streaming pager: initial commit. Fixes pallets#409
The streaming pager works using generators. Just pass a generator function or object into echo_via_pager: generator expression: ``` click.echo_via_pager(("{}\n".format(i) for i in range(999999))) ``` generator function / expression: ``` def gen(): counter = 0 while True: counter++ yield counter click.echo_via_pager(gen) click.echo_via_pager(gen()) # you can pass both ```
- Loading branch information
Showing
3 changed files
with
81 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters