--- a/viewer.py Sat May 23 17:34:12 2015 +0800
+++ b/viewer.py Wed May 27 18:34:06 2015 +0800
- for cset in changesets:
- resultsq = self.conn.execute(
- 'SELECT mark, time, cache FROM results WHERE node = ?',
- for mark, time, cache in resultsq:
- results.setdefault(node, {}).setdefault(mark, [None, None, None, None])
- color = green_to_red(limits[mark][0:2], time) if time is not None else None
- results[node][mark][0:2] = [time, color]
- color = green_to_red(limits[mark][2:4], time) if time is not None else None
- results[node][mark][2:4] = [time, color]
+ resultsq = self.conn.execute(
+ 'SELECT node, mark, time, cache FROM results'
+ ' WHERE node IN (' + ','.join('?' * len(changesets)) + ')',
+ [cset['node'] for cset in changesets])
+ for node, mark, time, cache in resultsq:
+ results.setdefault(node, {}).setdefault(mark, [None, None, None, None])
+ color = green_to_red(limits[mark][0:2], time) if time is not None else None
+ results[node][mark][0:2] = [time, color]
+ color = green_to_red(limits[mark][2:4], time) if time is not None else None
+ results[node][mark][2:4] = [time, color]