summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2011-02-08 15:19:24 +0100
committerjasplin <qt-info@nokia.com>2011-02-08 15:19:24 +0100
commit7a2e5cc1f32a49d52384b311853c79b526738778 (patch)
tree12191bfc22e36a5be15c8dc11c85b7082731c438 /scripts
parent223b7560f5e823d99d4873aa4a6715ddf811f482 (diff)
Indicate for which snapshots rankings are available.
An 'R' in front of the SHA-1 indicates that rankings have been computed (and is available in the database) for this snapshot.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/listcontexts.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/listcontexts.py b/scripts/listcontexts.py
index 3de1d53..2a513a5 100644
--- a/scripts/listcontexts.py
+++ b/scripts/listcontexts.py
@@ -5,6 +5,13 @@ from dbaccess import execQuery
from misc import idToText, printJSONHeader
class ListContexts:
+
+ def rankingsExist(self, contextId):
+ rankings = execQuery(
+ "SELECT id FROM ranking WHERE context2Id = %d LIMIT 1;" % contextId)
+ return len(rankings) > 0
+
+
def execute(self):
# Get all host/platform/branch/sha1 combinations:
@@ -23,7 +30,9 @@ class ListContexts:
id, host, platform, branch, sha1, timestamp = contexts[0]
curHost, curPlatform, curBranch = host, platform, branch
- curSnapshots = [(idToText('sha1', sha1), timestamp, id)]
+ curSnapshots = [
+ (idToText('sha1', sha1), timestamp,
+ 1 if self.rankingsExist(id) else 0)]
for (id, host, platform, branch, sha1, timestamp) in contexts[1:]:
if (host, platform, branch) != (curHost, curPlatform, curBranch):
@@ -37,7 +46,9 @@ class ListContexts:
curHost, curPlatform, curBranch = host, platform, branch
curSnapshots = []
- curSnapshots.append((idToText('sha1', sha1), timestamp, id))
+ curSnapshots.append(
+ (idToText('sha1', sha1), timestamp,
+ 1 if self.rankingsExist(id) else 0))
self.writeOutput()