kopia lustrzana https://github.com/ihabunek/toot
Command to browse bookmarks from the CLI
rodzic
13fffd9fc1
commit
253eea12a6
|
@ -39,8 +39,9 @@ def get_timeline_generator(app, user, args):
|
|||
return api.home_timeline_generator(app, user, limit=args.count)
|
||||
|
||||
|
||||
def timeline(app, user, args):
|
||||
generator = get_timeline_generator(app, user, args)
|
||||
def timeline(app, user, args, generator=None):
|
||||
if not generator:
|
||||
generator = get_timeline_generator(app, user, args)
|
||||
|
||||
while True:
|
||||
try:
|
||||
|
@ -197,6 +198,10 @@ def unbookmark(app, user, args):
|
|||
print_out("<green>✓ Status unbookmarked</green>")
|
||||
|
||||
|
||||
def bookmarks(app, user, args):
|
||||
timeline(app, user, args, api.bookmark_timeline_generator(app, user, limit=args.count))
|
||||
|
||||
|
||||
def reblogged_by(app, user, args):
|
||||
for account in api.reblogged_by(app, user, args.status_id):
|
||||
print_out("{}\n @{}".format(account['display_name'], account['acct']))
|
||||
|
|
|
@ -191,7 +191,7 @@ common_timeline_args = [
|
|||
}),
|
||||
]
|
||||
|
||||
timeline_args = common_timeline_args + [
|
||||
timeline_and_bookmark_args = [
|
||||
(["-c", "--count"], {
|
||||
"type": timeline_count,
|
||||
"help": "number of toots to show per page (1-20, default 10).",
|
||||
|
@ -209,6 +209,8 @@ timeline_args = common_timeline_args + [
|
|||
}),
|
||||
]
|
||||
|
||||
timeline_args = common_timeline_args + timeline_and_bookmark_args
|
||||
|
||||
AUTH_COMMANDS = [
|
||||
Command(
|
||||
name="login",
|
||||
|
@ -340,6 +342,12 @@ READ_COMMANDS = [
|
|||
arguments=timeline_args,
|
||||
require_auth=True,
|
||||
),
|
||||
Command(
|
||||
name="bookmarks",
|
||||
description="Show bookmarked posts",
|
||||
arguments=timeline_and_bookmark_args,
|
||||
require_auth=True,
|
||||
),
|
||||
]
|
||||
|
||||
POST_COMMANDS = [
|
||||
|
|
Ładowanie…
Reference in New Issue