diff makeitso/makeitso.py @ 36:0cba953a03ca

fixed single-file test case
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 01 Jan 2011 22:13:33 -0800
parents 7e47ff4b0cd3
children 7cee2869bd7b
line wrap: on
line diff
--- a/makeitso/makeitso.py	Sat Jan 01 21:58:34 2011 -0800
+++ b/makeitso/makeitso.py	Sat Jan 01 22:13:33 2011 -0800
@@ -161,7 +161,7 @@
                 vars.update(self.read_variables(missing))
             else:
                 raise MissingVariablesException(missing)
-        self._substitute(**vars)
+        return self._substitute(**vars)
 
     def _substitute(self, **variables):
         return tempita.Template.substitute(self, **variables)
@@ -270,14 +270,15 @@
 
         assert templates, "No templates given!"
 
+        self.interactive = True
         self._templates = templates[:]
         self.templates = []
         self.output = output
         for template in templates:
             if os.path.isdir(template):
-                self.templates.append(DirectoryTemplate(template, output=output, **variables))
+                self.templates.append(DirectoryTemplate(template, interactive=self.interactive, output=output, **variables))
             else:
-                self.templates.append(URITemplate(template, output=output, **variables))
+                self.templates.append(URITemplate(template, interactive=self.interactive, output=output, **variables))
 
     def missing(self, **variables):
         vars = variables.copy()
@@ -381,8 +382,7 @@
                                 variables=variables)
     else:
         template = ContentTemplate(sys.stdin.read(), variables=variables)
-        content = sys.stdin.read()
-                            
+    template.substitute()
 
     # cleanup
     cleanup()