simpleplugin.py 文件源码

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

项目:plugin.video.auvio 作者: rickybiscus 项目源码 文件源码
def flush(self):
        """
        Save storage contents to disk

        This method saves new and changed :class:`Storage` contents to disk
        and invalidates the Storage instance. Unchanged Storage is not saved
        but simply invalidated.
        """
        contents = pickle.dumps(self._storage)
        if self._hash is None or md5(contents).hexdigest() != self._hash:
            tmp = self._filename + '.tmp'
            try:
                with open(tmp, 'wb') as fo:
                    fo.write(contents)
            except:
                os.remove(tmp)
                raise
            move(tmp, self._filename)  # Atomic save
        del self._storage
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号