Skip to content

Commit

Permalink
Merge branch 'textclient' of github.com:krajaratnam/buildbot
Browse files Browse the repository at this point in the history
  • Loading branch information
krajaratnam committed Feb 11, 2010
2 parents 6aef259 + 5eaeb61 commit bad3673
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
22 changes: 13 additions & 9 deletions buildbot/clients/base.py
Expand Up @@ -61,8 +61,17 @@ def remote_logChunk(self, buildername, build, stepname, step, logname, log,
print "logChunk[%s]: %s" % (ChunkTypes[channel], text)

class TextClient:
def __init__(self, master, events="steps"):
def __init__(self, master, events="steps", username="statusClient", passwd="clientpw"):
"""
@type master: string
@param master: a host:port string to masters L{buildbot.status.client.PBListener}
@type username: string
@param username:
@type passwd: string
@param passwd:
@type events: string, one of builders, builds, steps, logs, full
@param events: specify what level of detail should be reported.
- 'builders': only announce new/removed Builders
Expand All @@ -73,6 +82,8 @@ def __init__(self, master, events="steps"):
- 'full': also announce log contents
"""
self.master = master
self.username = username
self.passwd = passwd
self.listener = StatusClient(events)

def run(self):
Expand All @@ -89,7 +100,7 @@ def startConnecting(self):
print " expecting something more like localhost:8007"
raise
cf = pb.PBClientFactory()
creds = credentials.UsernamePassword("statusClient", "clientpw")
creds = credentials.UsernamePassword(self.username, self.passwd)
d = cf.login(creds)
reactor.connectTCP(host, port, cf)
d.addCallbacks(self.connected, self.not_connected)
Expand All @@ -116,10 +127,3 @@ def disconnected(self, ref):
reactor.stop()
except RuntimeError:
pass

if __name__ == '__main__':
master = "localhost:8007"
if len(sys.argv) > 1:
master = sys.argv[1]
c = TextClient()
c.run()
6 changes: 5 additions & 1 deletion buildbot/scripts/runner.py
Expand Up @@ -735,6 +735,8 @@ class StatusClientOptions(OptionsWithOptionsFile):
optParameters = [
["master", "m", None,
"Location of the buildmaster's status port (host:port)"],
["username", "u", "statusClient", "Username performing the trial build"],
["passwd", None, "clientpw", "password for PB authentication"],
]
buildbotOptions = [
[ 'masterstatus', 'master' ],
Expand All @@ -752,7 +754,9 @@ def statuslog(config):
if master is None:
raise usage.UsageError("master must be specified: on the command "
"line or in ~/.buildbot/options")
c = base.TextClient(master)
passwd = config.get('passwd')
username = config.get('username')
c = base.TextClient(master, username=username, passwd=passwd)
c.run()

def statusgui(config):
Expand Down

0 comments on commit bad3673

Please sign in to comment.