MCPcopy Index your code
hub / github.com/PyTables/PyTables / move_node

Method move_node

tables/file.py:1852–1891  ·  view source on GitHub ↗

Move the node specified by where and name to newparent/newname. Parameters ---------- where, name : path These arguments work as in :meth:`File.get_node`, referencing the node to be acted upon. newparent The destination group the n

(
        self,
        where: Node | str,
        newparent: Group | str | None = None,
        newname: str | None = None,
        name: str | None = None,
        overwrite: bool = False,
        createparents: bool = False,
    )

Source from the content-addressed store, hash-verified

1850 obj._f_rename(newname, overwrite)
1851
1852 def move_node(
1853 self,
1854 where: Node | str,
1855 newparent: Group | str | None = None,
1856 newname: str | None = None,
1857 name: str | None = None,
1858 overwrite: bool = False,
1859 createparents: bool = False,
1860 ) -> None:
1861 """Move the node specified by where and name to newparent/newname.
1862
1863 Parameters
1864 ----------
1865 where, name : path
1866 These arguments work as in
1867 :meth:`File.get_node`, referencing the node to be acted upon.
1868 newparent
1869 The destination group the node will be moved into (a
1870 path name or a Group instance). If it is
1871 not specified or None, the current parent
1872 group is chosen as the new parent.
1873 newname
1874 The new name to be assigned to the node in its
1875 destination (a string). If it is not specified or
1876 None, the current name is chosen as the
1877 new name.
1878 overwrite : bool, optional
1879 Whether to allow moving over another node, in which case that
1880 node is recursively removed before moving (not done by default).
1881 createparents : bool, optional
1882 If True, any necessary parents of newparent will be created.
1883 Defaults to False.
1884
1885 Notes
1886 -----
1887 The other arguments work as in :meth:`Node._f_move`.
1888
1889 """
1890 obj = self.get_node(where, name=name)
1891 obj._f_move(newparent, newname, overwrite, createparents)
1892
1893 def copy_node(
1894 self,

Callers 15

test07_moveMethod · 0.80
test10_moveLeafMethod · 0.80
test10b_moveLeafMethod · 0.80
test10c_moveLeafMethod · 0.80
test10_2_moveTableMethod · 0.80
test10_2b_moveTableMethod · 0.80
test10_2c_moveTableMethod · 0.80
test11_moveGroupMethod · 0.80

Calls 2

get_nodeMethod · 0.95
_f_moveMethod · 0.45

Tested by 15

test07_moveMethod · 0.64
test10_moveLeafMethod · 0.64
test10b_moveLeafMethod · 0.64
test10c_moveLeafMethod · 0.64
test10_2_moveTableMethod · 0.64
test10_2b_moveTableMethod · 0.64
test10_2c_moveTableMethod · 0.64
test11_moveGroupMethod · 0.64