diff makeitso/template.py @ 90:26b9c3bba04e

make the api for substitute() variables, output
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 10 Jan 2011 21:33:03 -0800
parents 712a6d358083
children d9c6e26a42ff
line wrap: on
line diff
--- a/makeitso/template.py	Mon Jan 10 19:58:21 2011 -0800
+++ b/makeitso/template.py	Mon Jan 10 21:33:03 2011 -0800
@@ -85,8 +85,7 @@
     # inspect the templates for more variables
     look = False
 
-    def __init__(self, output=None, interactive=True, usedefaults=True,
-                 variables=None):
+    def __init__(self, interactive=True, usedefaults=True, variables=None):
         """
         - output : output file or directory
         - interactive : whether tointeractively get variables
@@ -95,7 +94,6 @@
 
         # boilerplate
         variables = variables or {}
-        self.output = output
         if not self.description and hasattr(self, '__doc__'):
             self.description = self.__doc__
         self.interactive = interactive
@@ -151,7 +149,7 @@
     def pre(self, variables):
         """do stuff before interpolation"""
 
-    def substitute(self, output, **variables):
+    def substitute(self, variables, output):
         """do the substitution"""
         
         vars = self.get_variables(**variables)
@@ -163,7 +161,7 @@
                                 interactive=self.interactive,
                                 variables=vars)
         template.check_output(output)
-        template.substitute(output)
+        template.substitute({}, output)
                      
         self.post(vars)