29def parse_log_file(fname, step=Steps.ini):
30 beg_pat = re.compile(r"NameAuditor.*?About to Enter "
31 r"(?P<CompName>.*?) "
32 r"%s Method"%step)
33 end_pat = re.compile(r"NameAuditor.*?Just Exited "
34 r"(?P<CompName>.*?) "
35 r"%s Method"%step)
36
37 stack = 0
38 graph = []
39
40 for l in open(fname, 'r'):
41 l = l.strip()
42 beg = re.match(beg_pat, l)
43 end = re.match(end_pat, l)
44 if not (beg or end):
45 continue
46
47 if beg:
48 component = beg.group('CompName')
49
50 stack += 1
51 graph += [ (stack, component) ]
52
53 if end:
54 component = end.group('CompName')
55
56 stack -= 1
57
58 return graph
59
60