MCPcopy
hub / github.com/DedSecInside/TorBot / _build_tree

Method _build_tree

torbot/modules/linktree.py:63–73  ·  view source on GitHub ↗

Builds a tree from the root to the given depth.

(self, url: str, depth: int)

Source from the content-addressed store, hash-verified

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

Callers 1

loadMethod · 0.95

Calls 2

_append_nodeMethod · 0.95
parse_linksFunction · 0.85

Tested by

no test coverage detected