# HG changeset patch # User Jeff Hammel # Date 1294760039 28800 # Node ID b6a46332cceda1943af1c7393c3488ddd09d9c4b # Parent d5da38fabdf76b612d5323ad70333982160b37cc allow Polytemplates to take template objects diff -r d5da38fabdf7 -r b6a46332cced makeitso/makeitso.py --- a/makeitso/makeitso.py Tue Jan 11 07:30:31 2011 -0800 +++ b/makeitso/makeitso.py Tue Jan 11 07:33:59 2011 -0800 @@ -324,14 +324,17 @@ def __init__(self, templates, interactive=True, variables=None): self.interactive = interactive - self._templates = templates[:] self.templates = [] for template in templates: - # TODO: check if the template is a [e.g] PasteScript.template entry point - if os.path.isdir(template): - self.templates.append(DirectoryTemplate(template, interactive=self.interactive, variables=variables)) + if isinstance(template, basestring): + # TODO: check if the template is a [e.g] PasteScript.template entry point + if os.path.isdir(template): + self.templates.append(DirectoryTemplate(template, interactive=self.interactive, variables=variables)) + else: + self.templates.append(URITemplate(template, interactive=self.interactive, variables=variables)) else: - self.templates.append(URITemplate(template, interactive=self.interactive, variables=variables)) + # assume the template is an object that conforms to the API + self.templates.append(template) def missing(self, **variables): vars = variables.copy()