Classes | |
class | Color |
class | mymf |
class | Package |
class | SearchHit |
Functions | |
def | getDependenciesFromPythonFile |
def | getImportTree |
def | packageNameFromFilename |
def | transformIntoGraph |
Variables | |
list | _stack = [] |
def TreeCrawler::getDependenciesFromPythonFile | ( | filename, | |
toplevelname, | |||
path | |||
) |
Definition at line 151 of file TreeCrawler.py.
def TreeCrawler::getImportTree | ( | filename, | |
path | |||
) |
Definition at line 159 of file TreeCrawler.py.
00160 : 00161 toplevelname = packageNameFromFilename(filename) 00162 # get dependencies from given file 00163 globalDependencyDict = getDependenciesFromPythonFile(filename,toplevelname,path) 00164 00165 # transform this flat structure in a dependency tree 00166 dependencyGraph = transformIntoGraph(globalDependencyDict,toplevelname) 00167 return dependencyGraph
def TreeCrawler::packageNameFromFilename | ( | name | ) |
Definition at line 29 of file TreeCrawler.py.
def TreeCrawler::transformIntoGraph | ( | depgraph, | |
toplevel | |||
) |
Definition at line 130 of file TreeCrawler.py.
00131 : 00132 packageDict = {} 00133 # create the top level config 00134 packageDict[toplevel] = Package(toplevel, top = True) 00135 00136 # create package objects 00137 for key, value in depgraph.iteritems(): 00138 if key.count(".") == 2 and key != toplevel: 00139 packageDict[key] = Package(key) 00140 for name in value.keys(): 00141 if name.count(".") == 2: packageDict[name] = Package(name) 00142 # now create dependencies 00143 for key, value in depgraph.iteritems(): 00144 if key.count(".") == 2 or key == toplevel: 00145 package = packageDict[key] 00146 package.dependencies = [packageDict[name] for name in value.keys() if name.count(".") == 2] 00147 00148 # find and return the top level config 00149 return packageDict[toplevel] 00150
list TreeCrawler::_stack = [] |
Definition at line 45 of file TreeCrawler.py.