__main__.py 文件源码

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

项目:em 作者: nhynes 项目源码 文件源码
def proj_create(args, config, _extra_args):
    """Creates a new em-managed project."""
    tmpl_repo = config['project']['template_repo']
    try:
        pygit2.clone_repository(tmpl_repo, args.dest)

        # delete history of template
        shutil.rmtree(osp.join(args.dest, '.git'), ignore_errors=True)
        pygit2.init_repository(args.dest)
    except ValueError:
        pass  # already in a repo

    for em_dir in ['experiments', 'data']:
        dpath = osp.join(args.dest, em_dir)
        if not osp.isdir(dpath):
            os.mkdir(dpath)

    with shelve.open(osp.join(args.dest, '.em')) as emdb:
        emdb['__em__'] = {}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号