changeset 4:e46374799119

do the interpolation
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 10 May 2010 12:27:00 -0700
parents e700bd2ec289
children f7d485cedc80
files licenser/licenses.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/licenser/licenses.py	Mon May 10 12:17:38 2010 -0700
+++ b/licenser/licenses.py	Mon May 10 12:27:00 2010 -0700
@@ -1,5 +1,6 @@
 import os
 from datetime import datetime
+from string import Template
 
 class License(object):
   """Abstract base class for a license"""
@@ -51,7 +52,9 @@
       # print the license
       g = file(self.template)
       for line in g.readlines():
-        print >> f, '# %s' % line.rstrip()
+        line = line.rstrip()
+        _template = Template(line)
+        print >> f, '# %s' % _template.substitute(**variables)
       g.close()
 
       # print the rest of the file