Mercurial > mozilla > hg > talosnames
diff talosnames/api.py @ 12:a4aa9f83e3be
adding a thing for commands
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 10 Jul 2012 17:01:05 -0700 |
parents | 1029ddf7b806 |
children | 323a01abd180 |
line wrap: on
line diff
--- a/talosnames/api.py Tue Jul 10 16:26:57 2012 -0700 +++ b/talosnames/api.py Tue Jul 10 17:01:05 2012 -0700 @@ -1,8 +1,12 @@ +import os import re import require import sqlite3 +import sys import urllib2 +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) + class TalosNames(object): graphserver_sql = 'http://hg.mozilla.org/graphs/raw-file/tip/sql/data.sql' schema = 'http://hg.mozilla.org/graphs/raw-file/tip/sql/schema.sql' @@ -71,6 +75,9 @@ # project_branches = require.require(self.project_branches) module = require.require(self.buildbot_config) self.suites = module.SUITES + self.buildbot_commands = {} + for key, value in self.suites.items(): + self.buildbot_commands[key] = value['suites'] ### functions for fetching information @@ -81,6 +88,10 @@ if regex.match(name): return tbplname + def buildbot_command(self, name): + """gets the buildbot command for a particular suite""" + return self.buildbot_commands.get(name) + def __call__(self, name=None): retval = [] for short_name, graphserver_name in self.names.items():