Skip to content

Commit

Permalink
Use click echo instead of print
Browse files Browse the repository at this point in the history
  • Loading branch information
ihabunek committed Dec 13, 2023
1 parent ad7cfd4 commit 7ba2d9c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions toot/cli/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def instance(ctx: Context, instance_url: Optional[str], json: bool):
)

if json:
print(response.text)
click.echo(response.text)
else:
instance = from_dict(Instance, response.json())
print_instance(instance)
Expand All @@ -78,7 +78,7 @@ def search(ctx: Context, query: str, resolve: bool, json: bool):
"""Search for users or hashtags"""
response = api.search(ctx.app, ctx.user, query, resolve)
if json:
print(response.text)
click.echo(response.text)
else:
print_search_results(response.json())

Expand All @@ -91,7 +91,7 @@ def status(ctx: Context, status_id: str, json: bool):
"""Show a single status"""
response = api.fetch_status(ctx.app, ctx.user, status_id)
if json:
print(response.text)
click.echo(response.text)
else:
status = from_dict(Status, response.json())
print_status(status)
Expand All @@ -105,7 +105,7 @@ def thread(ctx: Context, status_id: str, json: bool):
"""Show thread for a toot."""
context_response = api.context(ctx.app, ctx.user, status_id)
if json:
print(context_response.text)
click.echo(context_response.text)
else:
toot = api.fetch_status(ctx.app, ctx.user, status_id).json()
context = context_response.json()
Expand Down

0 comments on commit 7ba2d9c

Please sign in to comment.