예제 #1
0
파일: instlClient.py 프로젝트: ynonp/instl
 def needed_by(self, iid):
     try:
         from pyinstl import installItemGraph
         InstallItem.begin_get_for_all_oses()
         graph = installItemGraph.create_dependencies_graph(self.install_definitions_index)
         needed_by_list = installItemGraph.find_needed_by(graph, iid)
         InstallItem.reset_get_for_all_oses()
         return needed_by_list
     except ImportError: # no installItemGraph, no worry
         print("Could not load installItemGraph")
         return None
예제 #2
0
 def find_cycles(self):
         if not self.install_definitions_index:
             print ("index empty - nothing to check")
         else:
             try:
                 from pyinstl import installItemGraph
                 depend_graph = installItemGraph.create_dependencies_graph(self.install_definitions_index)
                 depend_cycles = installItemGraph.find_cycles(depend_graph)
                 if not depend_cycles:
                     print ("No depend cycles found")
                 else:
                     for cy in depend_cycles:
                         print("depend cycle:", " -> ".join(cy))
                 inherit_graph = installItemGraph.create_inheritItem_graph(self.install_definitions_index)
                 inherit_cycles = installItemGraph.find_cycles(inherit_graph)
                 if not inherit_cycles:
                     print ("No inherit cycles found")
                 else:
                     for cy in inherit_cycles:
                         print("inherit cycle:", " -> ".join(cy))
             except ImportError: # no installItemGraph, no worry
                 print("Could not load installItemGraph")