precache.py 文件源码

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

项目:supotato 作者: everettjf 项目源码 文件源码
def clear_cache_directory():
    for root, dirs, files in os.walk(download_cache_directory):
        for d in dirs:
            if d == '.git':
                dirpath = os.path.join(root,d)
                # print('rm dir ' + dirpath)
                try:
                    os.rmdir(dirpath)
                except:
                    pass

        for f in files:
            if f.endswith('.h') or f.endswith('.m'):
                continue

            filepath = os.path.join(root, f)
            #remove
            try:
                # print('remove ' + filepath)
                os.remove(filepath)
            except:
                pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号