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

Method _g_remove

tables/node.py:505–525  ·  view source on GitHub ↗

Remove this node from the hierarchy. If the node has children, recursive removal must be stated by giving `recursive` a true value; otherwise, a `NodeError` will be raised. If `force` is set to true, the node will be removed no matter it has children or not

(self, recursive: bool, force: bool)

Source from the content-addressed store, hash-verified

503 self._v_isopen = False
504
505 def _g_remove(self, recursive: bool, force: bool) -> None:
506 """Remove this node from the hierarchy.
507
508 If the node has children, recursive removal must be stated by
509 giving `recursive` a true value; otherwise, a `NodeError` will
510 be raised.
511
512 If `force` is set to true, the node will be removed no matter it
513 has children or not (useful for deleting hard links).
514
515 It does not log the change.
516
517 """
518 # Remove the node from the PyTables hierarchy.
519 parent = self._v_parent
520 parent._g_unrefnode(self._v_name)
521 # Close the node itself.
522 self._f_close()
523 # hdf5extension operations:
524 # Remove the node from the HDF5 hierarchy.
525 self._g_delete(parent)
526
527 def _f_remove(self, recursive: bool = False, force: bool = False) -> None:
528 """Remove this node from the hierarchy.

Callers 6

_f_removeMethod · 0.95
_g_remove_and_logMethod · 0.45
_g__delattrMethod · 0.45
disable_undoMethod · 0.45
_logMethod · 0.45
test03_removeGroupMethod · 0.45

Calls 3

_f_closeMethod · 0.95
_g_unrefnodeMethod · 0.80
_g_deleteMethod · 0.80

Tested by 1

test03_removeGroupMethod · 0.36