bootstrap.py 文件源码

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

项目:Tktr 作者: Intuity 项目源码 文件源码
def normalize_to_url(option, opt_str, value, parser):
    if value:
        if '://' not in value:  # It doesn't smell like a URL.
            value = 'file://%s' % (
                urllib.pathname2url(
                    os.path.abspath(os.path.expanduser(value))),)
        if opt_str == '--download-base' and not value.endswith('/'):
            # Download base needs a trailing slash to make the world happy.
            value += '/'
    else:
        value = None
    name = opt_str[2:].replace('-', '_')
    setattr(parser.values, name, value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号