def entry_point():
args = docopt(DOC, version=VERSION)
path = args['<path>']
doc_type = get_doc_type(args)
fields = load_config(locate_config())
# load operator.
remote = fields.get(CONFIG_REMOTE, 'github')
if remote not in REGISTERED_REMOTES:
raise RuntimeError(
'FATAL: {0} is not a valid remote type.'.format(remote),
)
RemoteConfig, RemoteOperation = REGISTERED_REMOTES[remote]
ret_fname, resource_url = upload_file(
path, fields, RemoteConfig, RemoteOperation,
)
url = translate_url(
ret_fname,
resource_url,
doc_type,
)
if not args['--no-clipboard']:
pyperclip.copy(url)
print(url)
评论列表
文章目录