-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpost.py
More file actions
executable file
·31 lines (23 loc) · 805 Bytes
/
post.py
File metadata and controls
executable file
·31 lines (23 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
import click
from golosscripts.decorators import common_options, helper
@click.command()
@common_options
@helper
@click.argument('account', type=str)
@click.argument('title', type=str)
@click.argument('tags', type=str)
@click.argument('permlink', type=str)
@click.argument('file_', type=click.File())
@click.pass_context
def main(ctx, account, title, tags, permlink, file_):
"""
Publish post to the Blockchain.
\b ACCOUNT account to post from TITLE post title TAGS comma-separated tag list PERMLINK post permlink FILE path to
file containing post in markdown format or "-" for stdin
"""
body = file_.read()
tags = tags.split(',')
ctx.helper.post(title, body, author=account, permlink=permlink, tags=tags)
if __name__ == '__main__':
main()