Changeset 130


Ignore:
Timestamp:
10/03/14 12:43:33 (6 years ago)
Author:
astephen
Message:

improved summary.py script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CCCC/trunk/summary.py

    r85 r130  
    99for f in fl: 
    1010  for l in open(f).readlines(): 
     11    fn = string.split(f,'/')[-1] 
    1112    if string.find(l, 'FAILED') != -1: 
    1213      bits = string.split(l, ':' ) 
    1314      if len(bits) > 3: 
    1415        code = bits[0] 
    15         msg = bits[3] 
     16        msg = string.strip( string.join(bits[3:], ':' ) ) 
    1617        if code not in ee.keys(): 
    17           ee[code] = [0,msg] 
     18          ee[code] = [0,{msg:[0,[]]}] 
     19        elif msg not in ee[code][1].keys(): 
     20          ee[code][1][msg] = [0,[]] 
    1821        ee[code][0] += 1 
    19         if ee[code][1] != msg: 
    20           print 'code %s occurs with multiple messages: %s, %s' % (code,ee[code][1],msg) 
     22        ee[code][1][msg][0] += 1 
     23        if ee[code][1][msg][0] < 10: 
     24          ee[code][1][msg][1].append(fn) 
    2125      else: 
    2226        print bits 
     
    2529keys.sort() 
    2630for k in keys: 
    27   print k,ee[k] 
     31  ks = ee[k][1].keys() 
     32  if len(ks) == 1: 
     33    print k,ee[k][0],ks[0] 
     34    for i in range(min(2,ee[k][0])): 
     35      print '               ',ee[k][1][ks[0]][1][i] 
     36  else: 
     37    print k,ee[k][0] 
     38    ks.sort() 
     39    for k2 in ks: 
     40      print '  --- ',k2,ee[k][1][k2][0] 
     41      for i in range(min(2,ee[k][1][k2][0])): 
     42        print '               ',ee[k][1][k2][1][i] 
    2843 
    2944 
Note: See TracChangeset for help on using the changeset viewer.