Mercurial > hg > truffle
diff mx/outputparser.py @ 4282:063ea022532c
mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
author | Gilles Duboscq <gilles.m.duboscq@gmail.com> |
---|---|
date | Fri, 13 Jan 2012 16:11:18 +0100 |
parents | 339cf8d4904d |
children | 3aab15f42934 |
line wrap: on
line diff
--- a/mx/outputparser.py Thu Jan 12 16:08:41 2012 +0100 +++ b/mx/outputparser.py Fri Jan 13 16:11:18 2012 +0100 @@ -37,7 +37,7 @@ self.matchers.append(matcher) def parse(self, vm, cmd, cwd=None, vmbuild=None): - ret = [{}] + ret = [] def parseLine(line): anyMatch = False @@ -45,7 +45,7 @@ parsed = matcher.parse(line.strip()) if parsed: anyMatch = True - if matcher.startNewLine and len(ret[0]) > 0: + if len(ret) is 0 or (matcher.startNewLine and len(ret[len(ret)-1]) > 0): ret.append({}) ret[len(ret)-1].update(parsed) if anyMatch :