File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323
2424
2525class Args (argparse .Namespace ):
26+ src : Path
2627 api_root : Path
2728 docs_dir : Path
2829 print_nav : bool
29- src : Path
3030
3131
3232@dataclasses .dataclass
3333class Nav :
34- module_path : str = ""
34+ module : str = ""
3535 index : str | None = None
3636 children : dict [str , Nav ] = dataclasses .field (default_factory = dict )
3737
3838 def add (self , parts : Sequence [str ], full_doc_path : Path ) -> None :
3939 if not parts :
40- self .index = os .fspath (full_doc_path )
40+ self .index : str = os .fspath (full_doc_path )
4141 return
4242 if parts [0 ] in self .children :
43- child = self .children [parts [0 ]]
43+ child : Nav = self .children [parts [0 ]]
4444 else :
45- child = type (self )(
46- module_path = f"{ self .module_path } .{ parts [0 ]} "
47- if self .module_path
48- else parts [0 ]
49- )
45+ child : Nav = type (self )(module = parts [0 ])
5046 self .children [parts [0 ]] = child
5147 child .add (parts [1 :], full_doc_path )
5248
@@ -58,7 +54,7 @@ def dump(self) -> Any:
5854 children .append (child .dump ())
5955 if len (children ) == 1 :
6056 return children [0 ]
61- return {f"{ MODULE_SYMBOL } { self .module_path } " : children }
57+ return {f"{ MODULE_SYMBOL } { self .module } " : children }
6258
6359
6460def is_public (part : str ) -> bool :
You can’t perform that action at this time.
0 commit comments