diff makeitso/makeitso.py @ 101:80a57bf2b7f4

fixed a few problems
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 11 Jan 2011 14:23:17 -0800
parents b6a46332cced
children a6aff990985b
line wrap: on
line diff
--- a/makeitso/makeitso.py	Tue Jan 11 12:04:25 2011 -0800
+++ b/makeitso/makeitso.py	Tue Jan 11 14:23:17 2011 -0800
@@ -165,8 +165,7 @@
                 vars.update(self.read_variables(missing))
             else:
                 raise MissingVariablesException(missing)
-        
-    
+            
     def variables(self):
         """return the variables needed for a template"""
         return self.missing()
@@ -208,6 +207,8 @@
                                  variables=variables)
 
     def substitute(self, variables, output=None):
+
+        # interpolate
         content = ContentTemplate.substitute(self, **variables)
 
         # write output
@@ -292,7 +293,7 @@
             # interpolate directory names
             for d in dirnames:
                 path = os.path.join(dirname, d)
-                interpolated = ContentTemplate(path).substitute(**variables)
+                interpolated = ContentTemplate(path).substitute(**vars)
                 target = os.path.join(output, interpolated.split(self.name, 1)[-1].strip(os.path.sep))
                 
                 if os.path.exists(target):
@@ -307,7 +308,7 @@
 
                 # interpolate filenames
                 path = os.path.join(dirname, filename)
-                interpolated = ContentTemplate(path).substitute(**variables)
+                interpolated = ContentTemplate(path).substitute(**vars)
                 target = os.path.join(output, interpolated.split(self.name, 1)[-1].strip(os.path.sep))
 
                 # interpolate their contents
@@ -315,7 +316,7 @@
                     # ensure its a directory
                     assert os.path.isfile(target), "Can't substitute a file on top of a directory"
                 template = URITemplate(path, interactive=False)
-                template.substitute(variables, target)
+                template.substitute(vars, target)
 
 
 class PolyTemplate(ContentTemplate):