view talosnames/main.py @ 11:b7b59561be5e

add talos
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 10 Jul 2012 16:26:57 -0700
parents 1029ddf7b806
children a4aa9f83e3be
line wrap: on
line source

#!/usr/bin/env python

"""
correlate names of talos
"""

import api
import sys
import optparse
from commandparser import CommandParser
from pprint import pprint

class TalosNamesCLI(object):
    def __init__(self):
        self.api = api.TalosNames()

    def graphserver(self, *names):
        """give graphserver names from test names"""
        if not names:
            names = [None]
        for arg in names:
            for name, graphserver_name in self.api(arg):
                print '%s : %s' % (name, graphserver_name)
            print

    def tbpl(self, name):
        """give TBPL name given the buildbot config name"""
        return self.api.tbpl_name(name)

def main(args=sys.argv[1:]):
    parser = CommandParser(TalosNamesCLI)
    parser.invoke(sys.argv[1:])

if __name__ == '__main__':
    main()