# HG changeset patch # User Jeff Hammel # Date 1325099258 28800 # Node ID 48bc52d5125287e855041a5e9c8a0d9456f19273 # Parent 76b4f58df3ee6fcfdd65d762480aae6bf8908219 make irc configurable diff -r 76b4f58df3ee -r 48bc52d51252 autobot/config.py --- a/autobot/config.py Wed Dec 28 10:27:51 2011 -0800 +++ b/autobot/config.py Wed Dec 28 11:07:38 2011 -0800 @@ -25,6 +25,11 @@ self.master = self.section_dict(master) for port, default in ('slaveport', 9010), ('htmlport', 8010), ('publichtmlport', 8011): self.master[port] = int(self.master.get(port) or default) + channels = self.master.get('channels', '').strip() + if channels: + self.master['channels'] = channels.split() + else: + self.master['channels'] = [] # get section information self.slaves = {} diff -r 76b4f58df3ee -r 48bc52d51252 autobot/template.py --- a/autobot/template.py Wed Dec 28 10:27:51 2011 -0800 +++ b/autobot/template.py Wed Dec 28 11:07:38 2011 -0800 @@ -51,7 +51,10 @@ Variable('passwd', 'buildslave password', default='passwd'), Variable('slaveport', 'port to talk to slaves on', default=9010, cast=int), Variable('htmlport', 'port for waterfall display', default=8010, cast=int), - Variable('publichtmlport', 'port for public waterfall display', default=8011, cast=int)] + Variable('publichtmlport', 'port for public waterfall display', default=8011, cast=int), + Variable('botname', 'name of IRC bot', default='autobot'), + Variable('ircHost', 'IRC host', default='irc.mozilla.org') + Variable('ircChannels', 'channels for the IRC bot', default='#ateam') def pre(self, variables, output): factory = variables.get('factories') diff -r 76b4f58df3ee -r 48bc52d51252 autobot/template/master/master.cfg --- a/autobot/template/master/master.cfg Wed Dec 28 10:27:51 2011 -0800 +++ b/autobot/template/master/master.cfg Wed Dec 28 11:07:38 2011 -0800 @@ -114,8 +114,11 @@ # irc bot from buildbot.status import words -c['status'].append(words.IRC(host="irc.mozilla.org", nick="autobot", - channels=["#ateam"])) +irc = config.master.get('irc', '') +if '@' in irc and config.master['channels']: + irc_host, nick = irc.split('@', 1): + c['status'].append(words.IRC(host=irc_host, nick=nick + channels=config.master['channels'])) ####### PROJECT IDENTITY diff -r 76b4f58df3ee -r 48bc52d51252 autobot/template/master/master.ini --- a/autobot/template/master/master.ini Wed Dec 28 10:27:51 2011 -0800 +++ b/autobot/template/master/master.ini Wed Dec 28 11:07:38 2011 -0800 @@ -6,6 +6,8 @@ publichtmlport = {{publichtmlport}} pollInterval = 30 treeStableTimer = 30 +irc = {{botname}}@{{ircHost}} +ircChannels = {{ircChannels}} [slave:{{slave}}] os = {{os}}