MCPcopy Create free account
hub / github.com/boostorg/build / add_child

Method add_child

v2/test/tree.py:49–62  ·  view source on GitHub ↗
(self, newchild)

Source from the content-addressed store, hash-verified

47 self.path = name
48
49 def add_child(self, newchild):
50 assert not self.is_file()
51 for a in self.children:
52 if a.name == newchild.name:
53 if newchild.is_file():
54 a.contents = newchild.contents
55 a.path = os.path.join(self.path, newchild.name)
56 else:
57 for i in newchild.children:
58 a.add_child(i)
59 break
60 else:
61 self.children.append(newchild)
62 newchild.path = os.path.join(self.path, newchild.name)
63
64 def get_child(self, name):
65 """

Callers 1

_handle_dirFunction · 0.95

Calls 2

is_fileMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected