python scanning: order from chaos: pre-sort the ns3 module dependency graph to improve stability of the result
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Wed, 25 Nov 2009 11:41:46 +0000
changeset 5778 bb28b3985514
parent 5777 a7ca957db043
child 5779 6642920ad056
python scanning: order from chaos: pre-sort the ns3 module dependency graph to improve stability of the result
bindings/python/ns3modulescan.py
--- a/bindings/python/ns3modulescan.py	Wed Nov 25 10:51:37 2009 +0000
+++ b/bindings/python/ns3modulescan.py	Wed Nov 25 11:41:46 2009 +0000
@@ -262,7 +262,11 @@
     ## do a topological sort on the modules graph
     from topsort import topsort
     graph = []
-    for ns3_module_name, (ns3_module_deps, dummy) in ns3_modules.iteritems():
+    module_names = ns3_modules.keys()
+    module_names.sort()
+    for ns3_module_name in module_names:
+        ns3_module_deps = list(ns3_modules[ns3_module_name][0])
+        ns3_module_deps.sort()
         for dep in ns3_module_deps:
             graph.append((dep, ns3_module_name))
     sorted_ns3_modules = topsort(graph)