mirror of
https://github.com/ihabunek/toot.git
synced 2025-02-02 15:07:51 -05:00
Add toot status command
This commit is contained in:
parent
835f789145
commit
3a375b77ee
@ -3,6 +3,7 @@
|
|||||||
changes:
|
changes:
|
||||||
- "**BREAKING:** Require Python 3.7+"
|
- "**BREAKING:** Require Python 3.7+"
|
||||||
- "Add `timeline --account` option to show the account timeline (thanks Dan Schwarz)"
|
- "Add `timeline --account` option to show the account timeline (thanks Dan Schwarz)"
|
||||||
|
- "Add `toot status` command to show a single status
|
||||||
- "TUI: Add personal timeline (thanks Dan Schwarz)"
|
- "TUI: Add personal timeline (thanks Dan Schwarz)"
|
||||||
|
|
||||||
0.36.0:
|
0.36.0:
|
||||||
|
@ -9,7 +9,7 @@ from toot.auth import login_interactive, login_browser_interactive, create_app_i
|
|||||||
from toot.entities import Instance, Notification, Status, from_dict
|
from toot.entities import Instance, Notification, Status, from_dict
|
||||||
from toot.exceptions import ApiError, ConsoleError
|
from toot.exceptions import ApiError, ConsoleError
|
||||||
from toot.output import (print_lists, print_out, print_instance, print_account, print_acct_list,
|
from toot.output import (print_lists, print_out, print_instance, print_account, print_acct_list,
|
||||||
print_search_results, print_timeline, print_notifications, print_tag_list,
|
print_search_results, print_status, print_timeline, print_notifications, print_tag_list,
|
||||||
print_list_accounts, print_user_list)
|
print_list_accounts, print_user_list)
|
||||||
from toot.tui.utils import parse_datetime
|
from toot.tui.utils import parse_datetime
|
||||||
from toot.utils import args_get_instance, delete_tmp_status_file, editor_input, multiline_input, EOF_KEY
|
from toot.utils import args_get_instance, delete_tmp_status_file, editor_input, multiline_input, EOF_KEY
|
||||||
@ -68,6 +68,12 @@ def timeline(app, user, args, generator=None):
|
|||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
def status(app, user, args):
|
||||||
|
status = api.single_status(app, user, args.status_id)
|
||||||
|
status = from_dict(Status, status)
|
||||||
|
print_status(status)
|
||||||
|
|
||||||
|
|
||||||
def thread(app, user, args):
|
def thread(app, user, args):
|
||||||
toot = api.single_status(app, user, args.status_id)
|
toot = api.single_status(app, user, args.status_id)
|
||||||
context = api.context(app, user, args.status_id)
|
context = api.context(app, user, args.status_id)
|
||||||
|
@ -459,6 +459,16 @@ READ_COMMANDS = [
|
|||||||
],
|
],
|
||||||
require_auth=True,
|
require_auth=True,
|
||||||
),
|
),
|
||||||
|
Command(
|
||||||
|
name="status",
|
||||||
|
description="Show a single status",
|
||||||
|
arguments=[
|
||||||
|
(["status_id"], {
|
||||||
|
"help": "ID of the status to show.",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
require_auth=True,
|
||||||
|
),
|
||||||
Command(
|
Command(
|
||||||
name="timeline",
|
name="timeline",
|
||||||
description="Show recent items in a timeline (home by default)",
|
description="Show recent items in a timeline (home by default)",
|
||||||
|
@ -271,7 +271,7 @@ def print_search_results(results):
|
|||||||
print_out("<yellow>Nothing found</yellow>")
|
print_out("<yellow>Nothing found</yellow>")
|
||||||
|
|
||||||
|
|
||||||
def print_status(status: Status, width: int):
|
def print_status(status: Status, width: int = 80):
|
||||||
status_id = status.id
|
status_id = status.id
|
||||||
in_reply_to_id = status.in_reply_to_id
|
in_reply_to_id = status.in_reply_to_id
|
||||||
reblogged_by = status.account if status.reblog else None
|
reblogged_by = status.account if status.reblog else None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user