comparison mx/outputparser.py @ 4354:3abb137806c7

Merge.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 17 Jan 2012 23:35:39 +0100
parents 063ea022532c
children 3aab15f42934
comparison
equal deleted inserted replaced
4353:043bec543161 4354:3abb137806c7
35 35
36 def addMatcher(self, matcher): 36 def addMatcher(self, matcher):
37 self.matchers.append(matcher) 37 self.matchers.append(matcher)
38 38
39 def parse(self, vm, cmd, cwd=None, vmbuild=None): 39 def parse(self, vm, cmd, cwd=None, vmbuild=None):
40 ret = [{}] 40 ret = []
41 41
42 def parseLine(line): 42 def parseLine(line):
43 anyMatch = False 43 anyMatch = False
44 for matcher in self.matchers: 44 for matcher in self.matchers:
45 parsed = matcher.parse(line.strip()) 45 parsed = matcher.parse(line.strip())
46 if parsed: 46 if parsed:
47 anyMatch = True 47 anyMatch = True
48 if matcher.startNewLine and len(ret[0]) > 0: 48 if len(ret) is 0 or (matcher.startNewLine and len(ret[len(ret)-1]) > 0):
49 ret.append({}) 49 ret.append({})
50 ret[len(ret)-1].update(parsed) 50 ret[len(ret)-1].update(parsed)
51 if anyMatch : 51 if anyMatch :
52 mx.log('>' + line.rstrip()) 52 mx.log('>' + line.rstrip())
53 else : 53 else :