main.py 文件源码

python
阅读 14 收藏 0 点赞 0 评论 0

项目:img2url 作者: huntzhan 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号