Skip to content

Commit

Permalink
fix format.py
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMula committed Dec 1, 2016
1 parent 83d31b9 commit 2c9a2e8
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions format.py
Expand Up @@ -5,20 +5,23 @@
def format(file):
for line in file:
line = line.strip()
if ':' in line: # a measurment
F = line.split()
fun = F[0]
fun = fun[:fun.index('(')] # trim the signature
try:
pos = line.index(':')
except ValueError:
print line
continue

if 'error' in line:
print '%-50s : FAILED !!!' % fun
else:
best = float(F[2])
avg = float(F[7])
# a measurment
F = line[pos + 1:].split()
fun = line[:line.index('(')] # trim the signature

print '%-50s : %6.2f %6.2f' % (fun, best, avg)
if 'error' in line:
print '%-50s : FAILED !!!' % fun
else:
print line
best = float(F[0])
avg = float(F[5])

print '%-50s : %6.2f %6.2f' % (fun, best, avg)

if __name__ == '__main__':
format(sys.stdin)

0 comments on commit 2c9a2e8

Please sign in to comment.