mirror of
https://github.com/ihabunek/toot.git
synced 2025-02-02 15:07:51 -05:00
parent
42247f94ba
commit
a771ca3aa7
@ -7,6 +7,7 @@ Changelog
|
||||
* Add `toot notifications` to show notifications (thanks @dlax)
|
||||
* Add posting and replying to curses interface (thanks @Skehmatics)
|
||||
* Add `--language` option to `toot post`
|
||||
* Enable attaching upto 4 files via `--media` option on `toot post`
|
||||
|
||||
**0.21.0 (2019-02-15)**
|
||||
|
||||
|
@ -76,15 +76,18 @@ def curses(app, user, args):
|
||||
|
||||
|
||||
def post(app, user, args):
|
||||
if args.media and len(args.media) > 4:
|
||||
raise ConsoleError("Cannot attach more than 4 files.")
|
||||
|
||||
if args.media:
|
||||
media = _do_upload(app, user, args.media)
|
||||
media_ids = [media['id']]
|
||||
media = [_do_upload(app, user, file) for file in args.media]
|
||||
media_ids = [m["id"] for m in media]
|
||||
else:
|
||||
media = None
|
||||
media_ids = None
|
||||
|
||||
if media and not args.text:
|
||||
args.text = media['text_url']
|
||||
args.text = "\n".join(m['text_url'] for m in media)
|
||||
|
||||
if not args.text:
|
||||
print_out("Write or paste your toot. Press <yellow>{}</yellow> to post it.".format(EOF_KEY))
|
||||
|
@ -271,8 +271,10 @@ POST_COMMANDS = [
|
||||
"nargs": "?",
|
||||
}),
|
||||
(["-m", "--media"], {
|
||||
"type": FileType('rb'),
|
||||
"help": "path to the media file to attach"
|
||||
"action": "append",
|
||||
"type": FileType("rb"),
|
||||
"help": "path to the media file to attach (specify multiple "
|
||||
"times to attach up to 4 files)"
|
||||
}),
|
||||
(["-v", "--visibility"], {
|
||||
"type": visibility,
|
||||
|
Loading…
x
Reference in New Issue
Block a user