diff --git a/toot/cli/tags.py b/toot/cli/tags.py index 5cd7e90..a3784c7 100644 --- a/toot/cli/tags.py +++ b/toot/cli/tags.py @@ -8,7 +8,7 @@ from toot import api, http from toot.cli import Context, cli, json_option, pass_context from toot.cli.validators import validate_positive from toot.entities import Status, Tag, from_dict, from_response_list, from_responses_batched -from toot.output import green, print_tag_list, print_timeline, yellow +from toot.output import get_continue, green, print_tag_list, print_timeline, yellow from toot.utils import drop_empty_values, str_bool_nullable @@ -235,13 +235,3 @@ def timeline( click.secho("There may be more results. Increase the --limit or use --pager to see the rest.", dim=True) else: click.echo("No statuses found containing the given tag") - - -def get_continue(): - click.secho(f"Press {green('Space')} or {green('Enter')} to continue, {yellow('Esc')} or {yellow('q')} to break.") - while True: - char = click.getchar() - if char == ' ' or char == '\r': - return True - if char == '\x1b' or char == 'q': - return False diff --git a/toot/output.py b/toot/output.py index 49ea3e6..4ca4d19 100644 --- a/toot/output.py +++ b/toot/output.py @@ -29,6 +29,16 @@ def print_warning(text: str): click.secho(f"Warning: {text}", fg="yellow", err=True) +def get_continue(): + click.secho(f"Press {green('Space')} or {green('Enter')} to continue, {yellow('Esc')} or {yellow('q')} to break.") + while True: + char = click.getchar() + if char == ' ' or char == '\r': + return True + if char == '\x1b' or char == 'q': + return False + + def print_instance(instance: Instance): width = get_width() click.echo(instance_to_text(instance, width))