Mercurial > mozilla > hg > talosnames
changeset 13:323a01abd180
putting off this fun for later
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 10 Jul 2012 17:12:59 -0700 |
parents | a4aa9f83e3be |
children | 1b18b2746e69 |
files | talosnames/api.py talosnames/main.py |
diffstat | 2 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/talosnames/api.py Tue Jul 10 17:01:05 2012 -0700 +++ b/talosnames/api.py Tue Jul 10 17:12:59 2012 -0700 @@ -1,10 +1,14 @@ import os import re import require +import subprocess import sqlite3 import sys +import talos import urllib2 +talos_dir = os.path.dirname(os.path.abspath(talos.__file__)) + sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) class TalosNames(object): @@ -92,6 +96,10 @@ """gets the buildbot command for a particular suite""" return self.buildbot_commands.get(name) + def buildbot_config(self, name): + command = self.buildbot_command(name) + assert command is not None, "Suite not found: %s" % name + def __call__(self, name=None): retval = [] for short_name, graphserver_name in self.names.items():
--- a/talosnames/main.py Tue Jul 10 17:01:05 2012 -0700 +++ b/talosnames/main.py Tue Jul 10 17:12:59 2012 -0700 @@ -5,8 +5,9 @@ """ import api +import optparse +import subprocess import sys -import optparse from commandparser import CommandParser from pprint import pprint @@ -34,6 +35,9 @@ def command(self, suite): """returns the command that buildbot runs for a particular suite""" + command = self.api.buildbot_command(suite) + assert command is not None, "Suite not found; should be one of %s" % ', '.join(self.suites()) + return subprocess.list2cmdline(command) def tests(self): pass