# HG changeset patch # User Jeff Hammel # Date 1294453144 28800 # Node ID a32a7055f3e68b12032980ddd080c7b7fe5e3a75 # Parent a7e2f5b2a7e9d9c217f2a17e926b3951e33d4ef8 combine variables for buildbot master+slave diff -r a7e2f5b2a7e9 -r a32a7055f3e6 autobot/template.py --- a/autobot/template.py Fri Jan 07 17:07:02 2011 -0800 +++ b/autobot/template.py Fri Jan 07 18:19:04 2011 -0800 @@ -7,6 +7,7 @@ import os import sys from makeitso.cli import MakeItSoCLI +from makeitso.template import assemble from makeitso.template import MakeItSoTemplate from makeitso.template import Variable from projects import factories @@ -67,24 +68,11 @@ print ' '.join(command) call(command) -class AutobotTemplate(MakeItSoTemplate): +class AutobotTemplate(AutobotMasterTemplate, AutobotSlaveTemplate): name = 'autobot' description = 'template for the autotools buildbot master+slave' templates = ['template'] - def __init__(self, **kwargs): - - # get the variables - # TODO: move this upstream - names = set() - for variable in AutobotMasterTemplate.vars: - names.add(variable.name) - self.vars.append(variable.copy()) - for variable in AutobotSlaveTemplate.vars: - if variable.name not in names: - self.vars.append(variable.copy()) - MakeitSoTemplate.__init__(self, **kwargs) - - + vars = assemble(AutobotMasterTemplate, AutobotSlaveTemplate) # CLI front end functions # (console_script entry points) @@ -100,7 +88,7 @@ template.substitute() def create_autobot(args=sys.argv[1:]): - cli = MakeItSoCLI(AutobotSlaveTemplate) + cli = MakeItSoCLI(AutobotTemplate) template = cli.parse() template.substitute() diff -r a7e2f5b2a7e9 -r a32a7055f3e6 setup.py --- a/setup.py Fri Jan 07 17:07:02 2011 -0800 +++ b/setup.py Fri Jan 07 18:19:04 2011 -0800 @@ -26,6 +26,7 @@ entry_points=""" # -*- Entry points: -*- [console_scripts] + create-autobot = autobot.template:create_autobot create-autobot-master = autobot.template:create_master create-autobot-slave = autobot.template:create_slave """,