Fix a bug where the last page would not be printed

pull/530/head
Ivan Habunek 2025-03-06 09:56:46 +01:00
rodzic 4d72b1b6c8
commit 0285b4ce39
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 01DB3DD0D824504C
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -341,7 +341,7 @@ def _show_timeline(ctx, path, params, json, pager, clear, limit):
if pager:
responses = http.get_paged(ctx.app, ctx.user, path, params)
_print_paged(responses, pager, clear)
_print_paged(responses, clear)
return
response = http.get(ctx.app, ctx.user, path, params)
@ -358,7 +358,7 @@ def _show_anon_timeline(url, params, json, pager, clear, limit):
if pager:
responses = http.anon_get_paged(url, params)
_print_paged(responses, pager, clear)
_print_paged(responses, clear)
return
response = http.anon_get(url, params)
@ -380,7 +380,7 @@ def _print_single(response: Response, clear: bool, limit: Optional[int]):
click.echo("No statuses found")
def _print_paged(responses: Iterable[Response], page_size: int, clear: bool):
def _print_paged(responses: Iterable[Response], clear: bool):
width = get_max_width()
height = get_terminal_height()
separator = "" * width
@ -396,6 +396,9 @@ def _print_paged(responses: Iterable[Response], page_size: int, clear: bool):
batch_lines = []
batch_lines.extend(lines)
if batch_lines:
yield "\n".join(batch_lines) + "\n" + separator
first = True
printed_any = False
for page in _page_generator():