# HG changeset patch # User Jeff Hammel # Date 1294452583 28800 # Node ID f44af8f30147352e624f9d7f3bd2e7fa3003e1d1 # Parent 95d1bb85ab3cd0b54f41b766fcdf422930fa1718 add function to assemble variables diff -r 95d1bb85ab3c -r f44af8f30147 makeitso/template.py --- a/makeitso/template.py Fri Jan 07 16:53:55 2011 -0800 +++ b/makeitso/template.py Fri Jan 07 18:09:43 2011 -0800 @@ -50,6 +50,18 @@ else: return 'Enter %s:' % description +def assemble(*args): + names = set() + retval = [] + for arg in args: + if isinstance(arg, MakeItSoTemplate): + arg = arg.vars + for variable in args: + if variable.name in names: + continue + retval.append(variable.copy()) + return retval + class MakeItSoTemplate(ContentTemplate): """API template for MakeItSo"""