engine.py 文件源码

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

项目:tm-librarian 作者: FabricAttachedMemory 项目源码 文件源码
def cmd_destroy_shelf(self, cmdict):
        """ For a shelf, zombify books (mark for zeroing) and remove xattrs
            In (dict)---
                path
                node
            Out (dict) ---
                shelf data
        """
        self.errno = errno.EBUSY
        shelf = self.cmd_get_shelf(cmdict)
        assert not self.db.open_count(
            shelf), '%s has active opens' % shelf.name
        bos = self._list_shelf_books(shelf)
        xattrs = self.db.list_xattrs(shelf)
        for thisbos in bos:
            self.db.delete_bos(thisbos)
            _ = self._set_book_alloc(thisbos, TMBook.ALLOC_ZOMBIE)
        for xattr in xattrs:
            self.db.remove_xattr(shelf, xattr)
        rsp = self.db.delete_shelf(shelf, commit=True)

        return rsp
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号