diff --git a/z3c/recipe/filetemplate/__init__.py b/z3c/recipe/filetemplate/__init__.py index a1ca7c3..a6cba0a 100644 --- a/z3c/recipe/filetemplate/__init__.py +++ b/z3c/recipe/filetemplate/__init__.py @@ -110,15 +110,16 @@ def __init__(self, buildout, name, options): self.actions = [] # each entry is tuple of # (relative path, source last-modified-time, mode) if self.recursive: - for root, dirname, names in os.walk(self.source_dir): - relative_prefix = dirname[len(self.source_dir)+1:] + # def visit(ignored, dirname, names): + for directory, dirnames, names in os.walk(self.source_dir): + relative_prefix = directory[len(self.source_dir)+1:] if relative_prefix in self.exclude_dirs: # exclude current directory and its subdirectories del names[:] return file_info = {} for name in names: - val = os.path.join(root, name) + val = os.path.join(relative_prefix, name) source = os.path.join(self.source_dir, val) statinfo = os.stat(source) last_modified = statinfo.st_mtime @@ -551,4 +552,4 @@ def _relative_depth(common, path): break n += 1 path = dirname - return n \ No newline at end of file + return n