def printDependencyTrees(programList): for program in programList: treeString = '' for index, dependency in enumerate(registry.getDependencyTree(program)): if index > 0: treeString = ''.join([treeString, ' ' * index, '|__', dependency, '\n']) else: treeString = ''.join([treeString, dependency, '\n']) print(treeString)
def printDependencyTrees(programList): for program in programList: treeString = '' for index, dependency in enumerate( registry.getDependencyTree(program)): if index > 0: treeString = ''.join( [treeString, ' ' * index, '|__', dependency, '\n']) else: treeString = ''.join([treeString, dependency, '\n']) print(treeString)
def installProgramAndDependencies(programName, useCache): """ Build the dependencytree and install bottom->up """ if registry.isProgramInstalled(programName): print("<{0}> is already installed.".format(programName)) else: #get dependencytree and install bottom->up dependencyTree = reversed(registry.getDependencyTree(programName)) programsToBeInstalled = [] for dependency in dependencyTree: if not registry.isProgramInstalled(dependency): programsToBeInstalled.append(dependency) print("The following programs will be installed.") for program in programsToBeInstalled: print(program) for program in programsToBeInstalled: installProgram(program, useCache)