Mercurial > hg > MakeItSo
changeset 112:51c9cb49edec
fix a few minor issues
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 14 Jan 2011 18:36:24 -0800 |
parents | bad70fb08b15 |
children | c3b8ce33d3ad |
files | makeitso/makeitso.py makeitso/template.py |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/makeitso/makeitso.py Fri Jan 14 18:25:36 2011 -0800 +++ b/makeitso/makeitso.py Fri Jan 14 18:36:24 2011 -0800 @@ -180,7 +180,6 @@ def read_variables(self, variables): """read variables from stdin""" - # TODO: variables should (optionally) be richer objects retval = {} for i in variables: print 'Enter %s: ' % i, @@ -341,6 +340,12 @@ # assume the template is an object that conforms to the API self.templates.append(template) + def get_variables(self, **variables): + vars = variables.copy() + for template in self.templates: + vars.update(template.get_variables()) + return vars + def missing(self, **variables): vars = variables.copy() missing = set([])
--- a/makeitso/template.py Fri Jan 14 18:25:36 2011 -0800 +++ b/makeitso/template.py Fri Jan 14 18:36:24 2011 -0800 @@ -154,7 +154,7 @@ if self.look: # scan templates for other variables template = PolyTemplate(self._templates, - interactive=self.interactive, + interactive=False, variables=vars) missing.update(template.missing())