Prevent toot timeline to break when piped to extenal programs

Toot timeline try to ask the user to continue in the next page. This
doesn't works if the command is piped to any other software.

We stop the query in the first loop when not in a tty context. The
command should be called with the expected item count in this case.
pull/193/head
Stacy Harper 2021-06-16 22:36:29 +02:00 zatwierdzone przez Ivan Habunek
rodzic 2c42078b16
commit 6115cea43e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
2 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -3,6 +3,7 @@
changes:
- "Add `--scheduled-at` option to `toot post`, allows scheduling toots"
- "Add `--description` option to `toot post`, for adding descriptions to media attachments (thanks @ansuz)"
- "Disable paging timeline when output is piped (thanks @stacyharper)"
0.27.0:
date: 2020-06-15

Wyświetl plik

@ -52,7 +52,7 @@ def timeline(app, user, args):
print_timeline(items)
if args.once:
if args.once or not sys.stdout.isatty():
break
char = input("\nContinue? [Y/n] ")