(self, newchild)
| 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 | """ |
no test coverage detected