Builds a tree from the root to the given depth.
(self, url: str, depth: int)
| 61 | logging.debug(f"found a duplicate URL {id}") |
| 62 | |
| 63 | def _build_tree(self, url: str, depth: int) -> None: |
| 64 | """ |
| 65 | Builds a tree from the root to the given depth. |
| 66 | """ |
| 67 | if depth > 0: |
| 68 | depth -= 1 |
| 69 | resp = self._client.get(url) |
| 70 | children = parse_links(resp.text) |
| 71 | for child in children: |
| 72 | self._append_node(id=child, parent_id=url) |
| 73 | self._build_tree(url=child, depth=depth) |
| 74 | |
| 75 | def _get_tree_file_name(self) -> str: |
| 76 | root_id = self.root |
no test coverage detected