Make Python bindings depend only on NS-3 modules that have been API-scanned, not all modules.
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Mon, 14 Jul 2008 11:25:10 +0100
changeset 3423 f84261098ab0
parent 3422 ad0c05e68792
child 3424 fd8ae9ea848b
child 3453 85308840a251
child 3454 765d0cb5c56e
Make Python bindings depend only on NS-3 modules that have been API-scanned, not all modules.
bindings/python/wscript
--- a/bindings/python/wscript	Sun Jul 13 18:08:48 2008 +0100
+++ b/bindings/python/wscript	Mon Jul 14 11:25:10 2008 +0100
@@ -327,11 +327,24 @@
         bindgen.hidden_inputs = ['everything.h',
                                  'ns3modulegen_generated.py',
                                  'ns3modulegen_core_customizations.py']
-        for module in get_modules_and_headers().iterkeys():
-            bindgen.hidden_inputs.append("ns3_module_%s.py" % module.replace('-', '_'))
+
+        ## Get a list of scanned modules; the set of scanned modules
+        ## may be smaller than the set of all modules, in case a new
+        ## ns3 module is being developed which wasn't scanned yet.
+        scanned_modules = []
+        for filename in os.listdir(bindgen.path.abspath()):
+            m = re.match(r"^ns3_module_(.+)\.py$", filename)
+            if m is None:
+                continue
+            scanned_modules.append(m.group(1))
+            
+        for module in scanned_modules:
+            bindgen.hidden_inputs.append("ns3_module_%s.py" % module)
+
         bindgen.hidden_outputs = ['ns3module.h']
-        for module in get_modules_and_headers().iterkeys():
-            bindgen.hidden_outputs.append("ns3_module_%s.cc" % module.replace('-', '_'))
+        for module in scanned_modules:
+            bindgen.hidden_outputs.append("ns3_module_%s.cc" % module)
+
         bindgen.prio = 50
 
         bindgen.os_env = dict(os.environ)