whitewater.py 文件源码

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

项目:whitewater-encoder 作者: samiare 项目源码 文件源码
def _copy_temp_directory(self):
        """Copy the temp directory to the output directory."""

        if os.path.exists(self.paths['output']):

            oldfiles = [f for f in os.listdir(self.paths['output'])]
            for oldfile in oldfiles:
                os.remove(os.path.join(self.paths['output'], oldfile))

            newfiles = [f for f in os.listdir(self.paths['temp'])]
            for newfile in newfiles:
                shutil.copy2(os.path.join(self.paths['temp'], newfile), self.paths['output'])

        else:
            try:
                shutil.copytree(self.paths['temp'], self.paths['output'])
            except shutil.Error as err:
                self.exit(err)

        shutil.rmtree(self.paths['temp'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号