# HG changeset patch # User Jeff Hammel # Date 1294434310 28800 # Node ID 9ad3a9e220bce496ddf486de4fa594930985b39b # Parent d7c4e9d6d9dd32f58845bea3b5d02d3b4dac6c6c get factory from command line diff -r d7c4e9d6d9dd -r 9ad3a9e220bc autobot/template.py --- a/autobot/template.py Fri Jan 07 12:45:13 2011 -0800 +++ b/autobot/template.py Fri Jan 07 13:05:10 2011 -0800 @@ -7,9 +7,9 @@ import os import sys from makeitso.cli import MakeItSoCLI -from makeitso.projects import factories from makeitso.template import MakeItSoTemplate from makeitso.template import Variable +from projects import factories class AutobotMasterTemplate(MakeItSoTemplate): name = 'autobot-master' @@ -21,17 +21,19 @@ Variable('htmlport', 'port for waterfall display', default=8010)] def pre(self, variables): - factory = variables.get['factory'] + factory = variables.get('factory') if factory: assert factory in factories, 'Factory must be one of: ' % ', '.join(factories.keys()) elif self.interactive: - print 'Please select a Factory:\n' + print 'Factories:\n' for key in sorted(factories.keys()): print '%s:' % key print getattr(factories[key], '__doc__', '').strip() print + sys.stdout.write('Enter factory: ') factory = raw_input() assert factory in factories, 'Factory must be one of: ' % ', '.join(factories.keys()) + variables['factory'] = factory else: raise AssertionError("No factory provided") @@ -41,10 +43,6 @@ templates = [os.path.join('template', 'slave')] look = True -class MasterTemplateCLI(MakeItSoCLI): - def __init__(self): - - def main(args=sys.argv[1:]): cli = MakeItSoCLI(AutobotMasterTemplate) template = cli.parse()