love.py 文件源码

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

项目:lover 作者: jerluc 项目源码 文件源码
def archive(env):
    print('Archiving LOVE project \'%s\'...' % env.conf.identifier)
    # Archives the project directory into a .love file
    if not os.path.exists(env.dist_dir):
        os.makedirs(env.dist_dir)

    # Creates the .zip file
    tmp_dir = tempfile.mkdtemp()
    copytree(env.project_dir, tmp_dir, ignore=ignored_files)
    shutil.make_archive(env.love_file, 'zip', tmp_dir)
    shutil.rmtree(tmp_dir)

    # Renames to .love, since shutil.make_archive() adds .zip
    os.rename(env.love_file + '.zip', env.love_file)
    print('Archival complete!')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号