Download:
child 14:1c5afefb3d78
parent 12:10e706a1f650
13:dce6d8966d49
Anton Shestakov <engored@ya.ru>, Wed, 06 May 2015 00:02:17 +0800
viewer: second time in .asc view

1 файлов изменено, 8 вставок(+), 4 удалений(-) [+]
viewer.py file | annotate | diff | comparison | revisions
--- a/viewer.py Tue May 05 23:53:29 2015 +0800
+++ b/viewer.py Wed May 06 00:02:17 2015 +0800
@@ -115,10 +115,14 @@
for match in matches:
msg = []
rows = self.conn.execute(
- 'SELECT mark, time FROM results WHERE node = ? AND cache = ?',
- (match, False))
- for row in rows:
- msg.append('{}: {:.2g}s'.format(*row))
+ 'SELECT mark, time, cache FROM results WHERE node = ?',
+ (match,))
+ matchtimes = {}
+ for mark, time, cache in rows:
+ matchtimes.setdefault(mark, [None, None])
+ matchtimes[mark][1 if cache else 0] = time
+ for mark in MARKS:
+ msg.append('{mark}: {0:.2f}s/{1:.2f}s'.format(*matchtimes[mark], mark=mark))
line = line.replace(match, ' '.join(msg))
self.write(line)
self.finish()