Mercurial > mozilla > hg > talosnames
comparison talosnames/main.py @ 9:ab2bd5dda72c
basic form
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 10 Jul 2012 14:54:03 -0700 |
parents | 20c42ae0f7b7 |
children | 1029ddf7b806 |
comparison
equal
deleted
inserted
replaced
8:20c42ae0f7b7 | 9:ab2bd5dda72c |
---|---|
8 import sys | 8 import sys |
9 import optparse | 9 import optparse |
10 from commandparser import CommandParser | 10 from commandparser import CommandParser |
11 from pprint import pprint | 11 from pprint import pprint |
12 | 12 |
13 class TalosNamesCLI(CommandParser): | 13 class TalosNamesCLI(object): |
14 def __init__(self): | 14 def __init__(self): |
15 self.api = api.TalosNames() | 15 self.api = api.TalosNames() |
16 | 16 |
17 def graphserver(self, *names): | 17 def graphserver(self, *names): |
18 if not names: | 18 if not names: |
19 names = [None] | 19 names = [None] |
20 for arg in args: | 20 for arg in names: |
21 for name, graphserver_name in names(arg): | 21 for name, graphserver_name in self.api(arg): |
22 print '%s : %s' % (name, graphserver_name) | 22 print '%s : %s' % (name, graphserver_name) |
23 print | 23 print |
24 | 24 |
25 def main(args=sys.argv[1:]): | 25 def main(args=sys.argv[1:]): |
26 parser = CommandParser(TalosNamesCLI) | 26 parser = CommandParser(TalosNamesCLI) |