3 # Command line buildbot status client
8 from twisted.python import usage
9 from twisted.internet import reactor
11 OPT_LIST_BUILDERS = 'list-builders'
13 class Options(usage.Options):
16 [OPT_LIST_BUILDERS, 'b', 'List available builders'],
19 def list_builders(connect_result, client):
20 """List builders by name."""
22 d = client.getBuilderNames()
25 lambda names: [sys.stdout.write('%s\n' % name) for name in names])
27 d.addBoth(lambda arg: reactor.stop())
29 if __name__ == '__main__':
31 # Command line options
36 options.parseOptions()
37 except usage.UsageError, errortext:
38 print '%s: %s' % (sys.argv[0], errortext)
39 print '%s: Try --help for usage details.' % (sys.argv[0])
42 # Make buildbot connection
44 from bbclient import BuildbotClient
46 client = BuildbotClient()
48 d = client.connect('ldl.fc.hp.com', 8019, 'statusClient', 'clientpw')
52 if options[OPT_LIST_BUILDERS] == 1:
53 d.addCallback(list_builders, client)
55 print '%s: Must specify an operation to perform!' % sys.argv[0]