Removes a child instance from the Tag's children. Args: child (Tag): The child to be removed.
(self, child)
| 492 | self.remove_child(self.children[k]) |
| 493 | |
| 494 | def remove_child(self, child): |
| 495 | """Removes a child instance from the Tag's children. |
| 496 | |
| 497 | Args: |
| 498 | child (Tag): The child to be removed. |
| 499 | """ |
| 500 | if child in self.children.values() and hasattr(child, 'identifier'): |
| 501 | for k in self.children.keys(): |
| 502 | if hasattr(self.children[k], 'identifier'): |
| 503 | if self.children[k].identifier == child.identifier: |
| 504 | if k in self._render_children_list: |
| 505 | self._render_children_list.remove(k) |
| 506 | self.children.pop(k) |
| 507 | # when the child is removed we stop the iteration |
| 508 | # this implies that a child replication should not be allowed |
| 509 | break |
| 510 | |
| 511 | |
| 512 | class Widget(Tag, EventSource): |
no test coverage detected