#!/usr/bin/python from string import strip from sys import stdin targets = {} smilies = {'slowdown': '☹' , 'speedup': '☺'} for line in stdin: line = map(strip, filter(None, line.split(' '))) if 9 == len(line): target, name = line[0:2] factor, dir = line[-2:] name = name.split('-') name, size = '-'.join(name[:-1]), name[-1] target_tests = targets.get(target, {}) name_tests = target_tests.get(name, {}) name_tests[int(size)] = (factor, dir) target_tests[name] = name_tests targets[target] = target_tests print '''\
' for size in sizes: print ' | %s | ' % size print '|
---|---|---|
%s | ' % name for size in sizes: result = tests.get(size) if result: factor, dir = result print '%s %s | ' % ( dir, factor, smilies[dir]) else: print '' print ' |