__init__.py 文件源码

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

项目:jgscm 作者: src-d 项目源码 文件源码
def delete_file(self, path):
        if path.startswith("/"):
            path = path[1:]
        bucket_name, bucket_path = self._parse_path(path)
        bucket = self._get_bucket(bucket_name, throw=True)
        if bucket_path == "":
            bucket.delete()
            del self._bucket_cache[bucket_name]
            return
        it = bucket.list_blobs(prefix=bucket_path, delimiter="/",
                               max_results=self.max_list_size)
        files = list(islice(it, self.max_list_size))
        folders = it.prefixes
        bucket.delete_blobs(files)
        for folder in folders:
            self.delete_file(bucket_name + "/" + folder)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号