Imports a package and sub-packages into a tree based Class structure.
Sub-packages become child PackageTree instances of the root PackageTree.
Classes in a package become attributes of the PackageTree.
The package must be available on the python path and able to be imported.
Example:
RootPackage:
packageA:
moduleA.py
- ClassA
- ClassAB
packageAA:
moduleAA.py
- ClassAA
packageB:
moduleB.py
- ClassB
- ClassBCWill become:
root = PackageTree(module="RootPackage")
root.packageA
root.packageB
root.packageA.ClassA
root.packageA.ClassAB
root.packageA.packageAA.ClassAA
root.packageB.ClassB
root.packageB.ClassBC