diff makeitso/template.py @ 100:b54898f7d8a9

now API template variables seem to work
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 11 Jan 2011 12:04:25 -0800
parents d9c6e26a42ff
children 80a57bf2b7f4
line wrap: on
line diff
--- a/makeitso/template.py	Tue Jan 11 11:53:02 2011 -0800
+++ b/makeitso/template.py	Tue Jan 11 12:04:25 2011 -0800
@@ -46,7 +46,7 @@
     def read(self, fd=sys.stdout):
         """prompt and read the variable from stdin"""
         fd.write(self.display())
-        self.set(raw_input())
+        return self.set(raw_input())
 
     def display(self):
         description = self.description or self.name
@@ -146,7 +146,7 @@
                 if var.default is Undefined:
                     missing.add(var.name)
                     continue
-                if self.usedefaults and not var.isset():
+                if (not self.usedefaults) and (not var.isset()):
                     missing.add(var.name)
             else:
                 missing.add(var.name)
@@ -163,7 +163,7 @@
     def pre(self, variables):
         """do stuff before interpolation"""
 
-    def substitute(self, variables, output):
+    def substitute(self, variables, output=None):
         """do the substitution"""
         
         vars = self.get_variables(**variables)