Download:
child 27:e5098c3301fb
parent 25:a98e0e20561c
26:05579dfd3e35
Anton Shestakov <engored@ya.ru>, Wed, 27 May 2015 18:56:20 +0800
viewer: ?local=1 to generate colors for only visible ("local") min/max values

1 файлов изменено, 14 вставок(+), 10 удалений(-) [+]
viewer.py file | annotate | diff | comparison | revisions
--- a/viewer.py Wed May 27 18:34:06 2015 +0800
+++ b/viewer.py Wed May 27 18:56:20 2015 +0800
@@ -54,20 +54,24 @@
return getinfo('first({}:0, {})'.format(rev, revcount))
- def getresults(self, changesets):
- results = {}
- limits = {
+ def getlimits(self, changesets=None):
+ query = 'SELECT MIN(time), MAX(time) FROM results WHERE mark = ? AND cache = ?'
+ extra = []
+ if changesets:
+ query += ' AND node IN (' + ','.join('?' * len(changesets)) + ')'
+ extra = [cset['node'] for cset in changesets]
+ return {
mark:
- self.conn.execute(
- 'SELECT MIN(time), MAX(time) FROM results WHERE mark = ? AND cache = ?',
- (mark, False)).fetchone()
+ self.conn.execute(query, [mark, False] + extra).fetchone()
+
- self.conn.execute(
- 'SELECT MIN(time), MAX(time) FROM results WHERE mark = ? AND cache = ?',
- (mark, True)).fetchone()
+ self.conn.execute(query, [mark, True] + extra).fetchone()
for mark in MARKS
}
+ def getresults(self, changesets, local=False):
+ results = {}
+ 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)) + ')',
@@ -131,7 +135,7 @@
def results_html(self):
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)