Transform a list of imported modules into a module tree
(self, items: list)
| 256 | yield from self.pprint_imports(subitems, indent + new_indent) |
| 257 | |
| 258 | def imports_to_tree(self, items: list) -> dict: |
| 259 | """ |
| 260 | Transform a list of imported modules into a module tree |
| 261 | """ |
| 262 | root = {} |
| 263 | for x in items: |
| 264 | parts = x.split(".") |
| 265 | current = root |
| 266 | for x in parts: |
| 267 | if x not in current: |
| 268 | current[x] = {} |
| 269 | current = current[x] |
| 270 | |
| 271 | return root |
| 272 | |
| 273 | def output_table(self, table: Table): |
| 274 | out = PrettyReport(fd=self._fd) |