--- a/viewer.py Wed May 27 18:34:06 2015 +0800
+++ b/viewer.py Wed May 27 18:56:20 2015 +0800
return getinfo('first({}:0, {})'.format(rev, revcount))
- def getresults(self, changesets):
+ def getlimits(self, changesets=None):
+ query = 'SELECT MIN(time), MAX(time) FROM results WHERE mark = ? AND cache = ?'
+ query += ' AND node IN (' + ','.join('?' * len(changesets)) + ')'
+ extra = [cset['node'] for cset in changesets]
- 'SELECT MIN(time), MAX(time) FROM results WHERE mark = ? AND cache = ?',
- (mark, False)).fetchone()
+ self.conn.execute(query, [mark, False] + extra).fetchone()
- 'SELECT MIN(time), MAX(time) FROM results WHERE mark = ? AND cache = ?',
- (mark, True)).fetchone()
+ self.conn.execute(query, [mark, True] + extra).fetchone()
+ def getresults(self, changesets, local=False):
+ limits = self.getlimits(changesets if local else None)
resultsq = self.conn.execute(
'SELECT node, mark, time, cache FROM results'
' WHERE node IN (' + ','.join('?' * len(changesets)) + ')',
changesets = self.getchangesets()
- results = self.getresults(changesets)
+ results = self.getresults(changesets, self.get_argument('local', False))
self.render('results.html', changesets=changesets, marks=MARKS, results=results)