MCPcopy Create free account
hub / github.com/PyTables/PyTables / _g_move

Method _g_move

tables/node.py:553–591  ·  view source on GitHub ↗

Move this node in the hierarchy. Moves the node into the given `newparent`, with the given `newname`. It does not log the change.

(self, newparent: Group, newname: str)

Source from the content-addressed store, hash-verified

551 move_to_shadow(file_, oldpathname)
552
553 def _g_move(self, newparent: Group, newname: str) -> None:
554 """Move this node in the hierarchy.
555
556 Moves the node into the given `newparent`, with the given
557 `newname`.
558
559 It does not log the change.
560
561 """
562 oldparent = self._v_parent
563 oldname = self._v_name
564 oldpathname = self._v_pathname # to move the HDF5 node
565
566 # Try to insert the node into the new parent.
567 newparent._g_refnode(self, newname)
568 # Remove the node from the new parent.
569 oldparent._g_unrefnode(oldname)
570
571 # Remove location information for this node.
572 self._g_del_location()
573 # Set new location information for this node.
574 self._g_set_location(newparent, newname)
575
576 # hdf5extension operations:
577 # Update node attributes.
578 self._g_new(newparent, self._v_name, init=False)
579 # Move the node.
580 # self._v_parent._g_move_node(oldpathname, self._v_pathname)
581 self._v_parent._g_move_node(
582 oldparent._v_objectid,
583 oldname,
584 newparent._v_objectid,
585 newname,
586 oldpathname,
587 self._v_pathname,
588 )
589
590 # Tell dependent objects about the new location of this node.
591 self._g_update_dependent()
592
593 def _f_rename(self, newname: str, overwrite: bool = False) -> None:
594 """Rename this node in place.

Callers 5

_f_moveMethod · 0.95
move_to_shadowFunction · 0.45
move_from_shadowFunction · 0.45
undo_moveFunction · 0.45
redo_moveFunction · 0.45

Calls 6

_g_del_locationMethod · 0.95
_g_set_locationMethod · 0.95
_g_update_dependentMethod · 0.95
_g_refnodeMethod · 0.80
_g_unrefnodeMethod · 0.80
_g_newMethod · 0.80

Tested by

no test coverage detected