MCPcopy Index your code
hub / github.com/FSoft-AI4Code/CodeWiki / load_module_tree

Method load_module_tree

codewiki/cli/html_generator.py:35–60  ·  view source on GitHub ↗

Load module tree from documentation directory. Args: docs_dir: Documentation directory path Returns: Module tree structure

(self, docs_dir: Path)

Source from the content-addressed store, hash-verified

33
34
35 def load_module_tree(self, docs_dir: Path) -> Dict[str, Any]:
36 """
37 Load module tree from documentation directory.
38
39 Args:
40 docs_dir: Documentation directory path
41
42 Returns:
43 Module tree structure
44 """
45 module_tree_path = docs_dir / "module_tree.json"
46 if not module_tree_path.exists():
47 # Fallback to a simple structure
48 return {
49 "Overview": {
50 "description": "Repository overview",
51 "components": [],
52 "children": {}
53 }
54 }
55
56 try:
57 content = safe_read(module_tree_path)
58 return json.loads(content)
59 except Exception as e:
60 raise FileSystemError(f"Failed to load module tree: {e}")
61
62 def load_metadata(self, docs_dir: Path) -> Optional[Dict[str, Any]]:
63 """

Callers 1

generateMethod · 0.95

Calls 2

safe_readFunction · 0.90
FileSystemErrorClass · 0.90

Tested by

no test coverage detected