# HG changeset patch # User Jeff Hammel # Date 1322175024 28800 # Node ID c04a53145f195ef37342dbcb2f9d446dc7ea841e # Parent 4566b3ac9838d99d72f2634e2bd276ffde390455 interpolate the files, i hope diff -r 4566b3ac9838 -r c04a53145f19 licenser/licenses.py --- a/licenser/licenses.py Thu Nov 24 14:25:56 2011 -0800 +++ b/licenser/licenses.py Thu Nov 24 14:50:24 2011 -0800 @@ -106,7 +106,7 @@ """ determines if a file is empty; that is, contains only comments """ - for line in self.lines() + for line in self.lines(): line = line.strip() if line and line[0] != '#': return False @@ -120,7 +120,7 @@ variables = [] # required variables - def __init__(self, filetypes=self.filetypes[:]): + def __init__(self, filetypes=filetypes[:]): if self.template: if not os.path.isabs(self.template): self.template = os.path.join(os.path.dirname(__file__), diff -r 4566b3ac9838 -r c04a53145f19 tests/doctest.txt --- a/tests/doctest.txt Thu Nov 24 14:25:56 2011 -0800 +++ b/tests/doctest.txt Thu Nov 24 14:50:24 2011 -0800 @@ -4,9 +4,15 @@ The obligatory imports:: >>> import licenser + >>> from licenser import licenses >>> import os -Run some tests:: +Sanity check:: >>> assert os.path.exists(directory) +Test MPL license:: + + >>> license = licenses.MPL() + >>> variables = {'author': 'Jeff Hammel', 'email': 'k0s@k0s.org'} + >>> license.interpolate(directory, variables)