Bug 1391 - .ns3rc does not allow comments as expected
authorMitch Watrous <watrous@u.washington.edu>
Thu, 26 Apr 2012 10:19:11 -0700
changeset 7865 eb55045524be
parent 7864 d0df2d56ae9c
child 7866 5d044e7085b8
Bug 1391 - .ns3rc does not allow comments as expected
utils.py
--- a/utils.py	Wed Apr 25 19:08:07 2012 -0700
+++ b/utils.py	Thu Apr 26 10:19:11 2012 -0700
@@ -26,6 +26,12 @@
         list_string = ""
         parsing_multiline_list = False
         for line in file_in:
+
+            # Remove any comments.
+            if '#' in line:
+                (line, comment) = line.split('#', 1)
+
+            # Parse the line.
             if list_name in line or parsing_multiline_list:
                 list_string += line
 
@@ -60,6 +66,12 @@
         # Look for the boolean variable.
         bool_found = False
         for line in file_in:
+
+            # Remove any comments.
+            if '#' in line:
+                (line, comment) = line.split('#', 1)
+
+            # Parse the line.
             if bool_name in line:
                 # Evaluate the variable's line once it is found.  Make
                 # the split function only split it once.