vcs.py 文件源码

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

项目:ave 作者: sonyxperiadev 项目源码 文件源码
def get_opt(argv):
    (opts, args) = getopt.gnu_getopt(
        argv, 's:r:d:t:', ['source=', 'refspec=', 'destination=', 'timeout=']
    )

    if args:
        args = ','.join(args)
        raise Exception('non-dashed options "%s" not recognized' % args)

    src     = None
    dst     = None
    refspec = None
    timeout = 600

    for (opt, arg) in opts:
        if   opt in ['-s', '--source']:
            src = arg
        elif opt in ['-r', '--refspec']:
            refspec = arg
        elif opt in ['-d', '--destination']:
            dst = arg
        elif opt in ['-t', '--timeout']:
            timeout = int(arg)

    return (src, dst, refspec, timeout)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号