cache.py 文件源码

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

项目:lol-subreddit-tools 作者: TheEnigmaBlade 项目源码 文件源码
def load_cached_storage(cache_file, default_size=1000):
    if cache_file is not None and os.path.exists(cache_file):
        print("Loading cache: {0}".format(cache_file))
        with bz2.open(cache_file, "rb") as file:
            try:
                cache = pickle.load(file)
                return cache
            except pickle.PickleError and EOFError:
                return None
    return ThingCache(cache_size=default_size, file=cache_file)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号