summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2011-01-31 19:27:47 +0100
committerJoão Abecasis <joao.abecasis@nokia.com>2011-02-02 14:30:27 +0100
commite636de45176e0c4cb10b41a9c74bff2e6391ca6c (patch)
tree6498bbafaee63c78c20b333972d23244b73f4639
parentfc1e25435551fb81043765e1cb41303be660bf4f (diff)
Adding new utility function for finding a context ID
, according to the new database schema. Reviewed-By: jasplin
-rw-r--r--scripts/misc.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/misc.py b/scripts/misc.py
index 5d01974..3fed597 100644
--- a/scripts/misc.py
+++ b/scripts/misc.py
@@ -55,6 +55,18 @@ def metricIdToLowerIsBetter(metricId):
return lib;
+def getContext(host, platform, branch, sha1):
+ result = execQuery("SELECT id FROM context"
+ " WHERE hostId = %d"
+ " AND platformId = %d"
+ " AND branchId = %d"
+ " AND sha1Id = %d"
+ "LIMIT 1;"
+ % (host, platform, branch, sha1))
+ if len(result):
+ return result[0][0]
+ return -1
+
# Returns the test case, test function, and data tag components of
# a benchmark of the form <tc>:<tf>(<dt>). The test case and test function
# components may not contain whitespace, or a ':', '(', or ')' character.