comparison autobot/template.py @ 73:d033843da35a

templates work again maybe
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 11 Jan 2011 14:23:39 -0800
parents 849bbc2e5572
children d94fbaac7c2c
comparison
equal deleted inserted replaced
72:4e5fe6883fd9 73:d033843da35a
39 vars = [Variable('slave', 'buildslave name', 'slave'), 39 vars = [Variable('slave', 'buildslave name', 'slave'),
40 Variable('passwd', 'buildslave password', default='passwd'), 40 Variable('passwd', 'buildslave password', default='passwd'),
41 Variable('slaveport', 'port to talk to slaves on', default=9010, cast=int), 41 Variable('slaveport', 'port to talk to slaves on', default=9010, cast=int),
42 Variable('htmlport', 'port for waterfall display', default=8010, cast=int)] 42 Variable('htmlport', 'port for waterfall display', default=8010, cast=int)]
43 43
44 def pre(self, variables): 44 def pre(self, variables, output):
45 factory = variables.get('factories') 45 factory = variables.get('factories')
46 if factory: 46 if factory:
47 assert(set(factory).issubset(factories.keys())), 'Factory must be one of: ' % ', '.join(factories.keys()) 47 assert(set(factory).issubset(factories.keys())), 'Factory must be one of: ' % ', '.join(factories.keys())
48 elif self.interactive: 48 elif self.interactive:
49 print print_descriptions() 49 print print_descriptions()
82 variables['passwd'] ] 82 variables['passwd'] ]
83 print ' '.join(command) 83 print ' '.join(command)
84 call(command) 84 call(command)
85 85
86 86
87 def post(self, variables): 87 def post(self, variables, output):
88 self.create(self.output, variables) 88 self.create(output, variables)
89 89
90 90
91 class AutobotTemplate(AutobotMasterTemplate, AutobotSlaveTemplate): 91 class AutobotTemplate(AutobotMasterTemplate, AutobotSlaveTemplate):
92 name = 'autobot' 92 name = 'autobot'
93 description = 'template for the autotools buildbot master+slave' 93 description = 'template for the autotools buildbot master+slave'
94 templates = ['template'] 94 templates = ['template']
95 vars = assemble(AutobotMasterTemplate, AutobotSlaveTemplate) 95 vars = assemble(AutobotMasterTemplate, AutobotSlaveTemplate)
96 vars.append(Variable('debug', default=True, cast='eval')) 96 vars.append(Variable('debug', default=True, cast='eval'))
97 97
98 def post(self, variables): 98 def post(self, variables, output):
99 AutobotMasterTemplate.create(self, os.path.join(self.output, 'master'), variables) 99 AutobotMasterTemplate.create(self, os.path.join(output, 'master'), variables)
100 AutobotSlaveTemplate.create(self, os.path.join(self.output, 'slave'), variables) 100 AutobotSlaveTemplate.create(self, os.path.join(output, 'slave'), variables)
101 101
102 102
103 class ProjectTemplate(MakeItSoTemplate): 103 class ProjectTemplate(MakeItSoTemplate):
104 """ 104 """
105 template for creating new autobot project stubs for testing 105 template for creating new autobot project stubs for testing