namespace.py 文件源码

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

项目:fluiddb 作者: fluidinfo 项目源码 文件源码
def delete(self, paths):
        """Delete L{Namespace}s matching C{paths}.

        @param paths: A sequence of L{Namespace.path}s.
        @raises NotEmptyError: Raised if the L{Namespace} is not empty.
        @return: A C{list} of C{(objectID, Namespace.path)} 2-tuples
            representing the deleted L{Namespace}s.
        """
        if isgenerator(paths):
            paths = list(paths)
        if getChildNamespaces(paths).any() or getChildTags(paths).any():
            raise NotEmptyError("Can't delete non-empty namespaces.")

        result = getNamespaces(paths=paths)
        deletedNamespaces = list(result.values(Namespace.objectID,
                                               Namespace.path))
        values = [(objectID, systemTag)
                  for objectID, _ in deletedNamespaces
                  for systemTag in (u'fluiddb/namespaces/description',
                                    u'fluiddb/namespaces/path')]
        if values:
            self._factory.tagValues(self._user).delete(values)
        result.remove()
        return deletedNamespaces
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号