diff mxtool/mx.py @ 12455:d08accd58925

added support for wrapping long lines in mx/projects by placing a "\" at the end of the line (like the C preprocessor accepts)
author Doug Simon <doug.simon@oracle.com>
date Thu, 17 Oct 2013 01:05:13 +0200
parents 3de38bb7bc1d
children a5d83166dca6
line wrap: on
line diff
--- a/mxtool/mx.py	Wed Oct 16 18:27:28 2013 +0200
+++ b/mxtool/mx.py	Thu Oct 17 01:05:13 2013 +0200
@@ -526,8 +526,15 @@
             raise KeyError
 
         with open(projectsFile) as f:
+            prefix = ''
             for line in f:
                 line = line.strip()
+                if line.endswith('\\'):
+                    prefix = prefix + line[:-1]
+                    continue
+                if len(prefix) != 0:
+                    line = prefix + line
+                    prefix = ''
                 if len(line) != 0 and line[0] != '#':
                     key, value = line.split('=', 1)