For a given module make a tree with the module as the root and the dependent modules as children.
(module, index, tree, moduleDependencies, treeDepth, level=0)
| 128 | return foundModules |
| 129 | |
| 130 | def MakeModuleTree(module, index, tree, moduleDependencies, treeDepth, level=0): |
| 131 | ''' |
| 132 | For a given module make a tree with the module as the root and the |
| 133 | dependent modules as children. |
| 134 | ''' |
| 135 | if module: |
| 136 | index = index + [module] |
| 137 | if treeDepth == 0 or level < treeDepth: |
| 138 | for m in moduleDependencies[module]: |
| 139 | level += 1 |
| 140 | MakeModuleTree(m, index, tree, moduleDependencies, treeDepth, level) |
| 141 | level -= 1 |
| 142 | Add(tree, index) |
| 143 | |
| 144 | # One-line Tree in Python |
| 145 | # See: https:gist.github.com/hrldcpr/2012250 |