comparison 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
comparison
equal deleted inserted replaced
12454:ce4836e0212d 12455:d08accd58925
524 if items[1].dir == self.dir: 524 if items[1].dir == self.dir:
525 return items[0] 525 return items[0]
526 raise KeyError 526 raise KeyError
527 527
528 with open(projectsFile) as f: 528 with open(projectsFile) as f:
529 prefix = ''
529 for line in f: 530 for line in f:
530 line = line.strip() 531 line = line.strip()
532 if line.endswith('\\'):
533 prefix = prefix + line[:-1]
534 continue
535 if len(prefix) != 0:
536 line = prefix + line
537 prefix = ''
531 if len(line) != 0 and line[0] != '#': 538 if len(line) != 0 and line[0] != '#':
532 key, value = line.split('=', 1) 539 key, value = line.split('=', 1)
533 540
534 parts = key.split('@') 541 parts = key.split('@')
535 542