# HG changeset patch # User Jeff Hammel # Date 1293950069 28800 # Node ID 9739212a63c3fd181755a522bd8ff4af7206df46 # Parent 7cee2869bd7b6c2cad5d277973203c0e61439329 found a serious problem: directories stubbornly substitute into themselves diff -r 7cee2869bd7b -r 9739212a63c3 examples/doctest.txt --- a/examples/doctest.txt Sat Jan 01 22:28:35 2011 -0800 +++ b/examples/doctest.txt Sat Jan 01 22:34:29 2011 -0800 @@ -42,4 +42,6 @@ >>> template = makeitso.PolyTemplate([exampledir], output=tempdir, interactive=False) >>> sorted(template.missing()) ['bar', 'foo', 'subdir'] - >>> shutil.rmtree(tempdir) + >>> template.substitute(foo='myfoo', bar='mybar', subdir='mysubdir') + >>> os.listdir(tempdir) + diff -r 7cee2869bd7b -r 9739212a63c3 makeitso/makeitso.py --- a/makeitso/makeitso.py Sat Jan 01 22:28:35 2011 -0800 +++ b/makeitso/makeitso.py Sat Jan 01 22:34:29 2011 -0800 @@ -255,8 +255,8 @@ # interpolate directory names for d in dirnames: - path = os.path.join(dirname, interpolated) - interpolated = ContentTemplate(path).substitute(**variables) + path = os.path.join(dirname, d) + interpolated = ContentTemplate(path).substitute(**variables) if os.path.exists(interpolated): # ensure its a directory pass