--- /dev/null
+#!/usr/bin/python
+#
+# Command line buildbot status client
+#
+
+import sys
+
+from twisted.python import usage
+from twisted.internet import reactor
+
+OPT_LIST_BUILDERS = 'list-builders'
+
+class Options(usage.Options):
+
+ optFlags = [
+ [OPT_LIST_BUILDERS, 'b', 'List available builders'],
+ ]
+
+def list_builders(connect_result, client):
+ """List builders by name."""
+
+ d = client.getBuilderNames()
+
+ d.addCallback(
+ lambda names: [sys.stdout.write('%s\n' % name) for name in names])
+
+ d.addBoth(lambda arg: reactor.stop())
+
+if __name__ == '__main__':
+
+ # Command line options
+
+ options = Options()
+
+ try:
+ options.parseOptions()
+ except usage.UsageError, errortext:
+ print '%s: %s' % (sys.argv[0], errortext)
+ print '%s: Try --help for usage details.' % (sys.argv[0])
+ sys.exit(1)
+
+ # Make buildbot connection
+
+ from bbclient import BuildbotClient
+
+ client = BuildbotClient()
+
+ d = client.connect('ldl.fc.hp.com', 8019, 'statusClient', 'clientpw')
+
+ # Execute commands
+
+ if options[OPT_LIST_BUILDERS] == 1:
+ d.addCallback(list_builders, client)
+ else:
+ print '%s: Must specify an operation to perform!' % sys.argv[0]
+ print options
+ sys.exit(1)
+
+ reactor.run()
def subscribe(self, mode, interval, target):
return self.remote.callRemote('subscribe', mode, interval, target)
+ def getBuilderNames(self):
+ return self.remote.callRemote('getBuilderNames')
+
def CommandLineOptions():
"""Return hostname, port, user and password command line options."""