示例#1
0
def moveFromShadow(file_, path):
    (shparent, shname) = file_._shadowName()
    node = shparent._f_getChild(shname)

    (pname, name) = splitPath(path)
    parent = file_._getNode(pname)
    node._g_move(parent, name)
示例#2
0
def moveFromShadow(file_, path):
    (shparent, shname) = file_._shadowName()
    node = shparent._f_getChild(shname)

    (pname, name) = splitPath(path)
    parent = file_._getNode(pname)
    node._g_move(parent, name)
示例#3
0
    def _g_setLocation(self, parentNode, name):
        """
        Set location-dependent attributes.

        Sets the location-dependent attributes of this node to reflect
        that it is placed under the specified `parentNode`, with the
        specified `name`.

        This also triggers the insertion of file references to this
        node.  If the maximum recommended tree depth is exceeded, a
        `PerformanceWarning` is issued.
        """

        file_ = parentNode._v_file
        parentDepth = parentNode._v_depth

        self._v_file = file_
        self._v_isopen = True

        rootUEP = file_.rootUEP
        if name.startswith(rootUEP):
            # This has been called from File._getNode()
            assert parentDepth == 0
            if rootUEP == "/":
                self._v_pathname = name
            else:
                self._v_pathname = name[len(rootUEP):]
            _, self._v_name = splitPath(name)
            self._v_depth = name.count("/") - rootUEP.count("/") + 1
        else:
            # If we enter here is because this has been called elsewhere
            self._v_name = name
            self._v_pathname = joinPath(parentNode._v_pathname, name)
            self._v_depth = parentDepth + 1

        # Check if the node is too deep in the tree.
        if parentDepth >= self._v_maxTreeDepth:
            warnings.warn("""\
node ``%s`` is exceeding the recommended maximum depth (%d);\
be ready to see PyTables asking for *lots* of memory and possibly slow I/O"""
                          % (self._v_pathname, self._v_maxTreeDepth),
                          PerformanceWarning)

        file_._refNode(self, self._v_pathname)
    def _g_setLocation(self, parentNode, name):
        """
        Set location-dependent attributes.

        Sets the location-dependent attributes of this node to reflect
        that it is placed under the specified `parentNode`, with the
        specified `name`.

        This also triggers the insertion of file references to this
        node.  If the maximum recommended tree depth is exceeded, a
        `PerformanceWarning` is issued.
        """

        file_ = parentNode._v_file
        parentDepth = parentNode._v_depth

        self._v_file = file_
        self._v_isopen = True

        rootUEP = file_.rootUEP
        if name.startswith(rootUEP):
            # This has been called from File._getNode()
            assert parentDepth == 0
            if rootUEP == "/":
                self._v_pathname = name
            else:
                self._v_pathname = name[len(rootUEP):]
            _, self._v_name = splitPath(name)
            self._v_depth = name.count("/") - rootUEP.count("/") + 1
        else:
            # If we enter here is because this has been called elsewhere
            self._v_name = name
            self._v_pathname = joinPath(parentNode._v_pathname, name)
            self._v_depth = parentDepth + 1

        # Check if the node is too deep in the tree.
        if parentDepth >= self._v_maxTreeDepth:
            warnings.warn(
                """\
node ``%s`` is exceeding the recommended maximum depth (%d);\
be ready to see PyTables asking for *lots* of memory and possibly slow I/O""" %
                (self._v_pathname, self._v_maxTreeDepth), PerformanceWarning)

        file_._refNode(self, self._v_pathname)
示例#5
0
def redoMove(file_, origpath, destpath):
    (destpname, destname) = splitPath(destpath)

    node = file_._getNode(origpath)
    destparent = file_._getNode(destpname)
    node._g_move(destparent, destname)
示例#6
0
def undoMove(file_, origpath, destpath):
    (origpname, origname) = splitPath(origpath)

    node = file_._getNode(destpath)
    origparent = file_._getNode(origpname)
    node._g_move(origparent, origname)
示例#7
0
 def _g_getparent(self):
     (parentPath, nodeName) = splitPath(self._v_pathname)
     return self._v_file._getNode(parentPath)
示例#8
0
def _indexPathnameOf_(nodePath):
    nodeParentPath, nodeName = splitPath(nodePath)
    return joinPath(nodeParentPath, _indexNameOf_(nodeName))
示例#9
0
def _indexPathnameOf(node):
    nodeParentPath = splitPath(node._v_pathname)[0]
    return joinPath(nodeParentPath, _indexNameOf(node))
示例#10
0
def redoMove(file_, origpath, destpath):
    (destpname, destname) = splitPath(destpath)

    node = file_._getNode(origpath)
    destparent = file_._getNode(destpname)
    node._g_move(destparent, destname)
示例#11
0
def undoMove(file_, origpath, destpath):
    (origpname, origname) = splitPath(origpath)

    node = file_._getNode(destpath)
    origparent = file_._getNode(origpname)
    node._g_move(origparent, origname)
示例#12
0
def _indexPathnameOf_(nodePath):
    nodeParentPath, nodeName = splitPath(nodePath)
    return joinPath(nodeParentPath, _indexNameOf_(nodeName))
示例#13
0
def _indexPathnameOf(node):
    nodeParentPath = splitPath(node._v_pathname)[0]
    return joinPath(nodeParentPath, _indexNameOf(node))
 def _g_getparent(self):
     (parentPath, nodeName) = splitPath(self._v_pathname)
     return self._v_file._getNode(parentPath)