Skip to content

Instantly share code, notes, and snippets.

@sehmaschine
Created January 22, 2013 14:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sehmaschine/4594929 to your computer and use it in GitHub Desktop.
Save sehmaschine/4594929 to your computer and use it in GitHub Desktop.
FileBrowser ... updated walk for FileSubmit with SEARCH_TRAVERSE
def _walk(self, path, filelisting):
"""
Recursively walks the path and collects all files and
directories.
Danger: Symbolic links can create cycles and this function
ends up in a regression.
"""
dirs, files = self.site.storage.listdir(path)
if dirs:
for d in dirs:
self._walk(os.path.join(path, d), filelisting)
filelisting.extend([path_strip(os.path.join(path,d), self.site.directory)])
if files:
for f in files:
filelisting.extend([path_strip(os.path.join(path,f), self.site.directory)])
#filelisting.extend(dirs)
#filelisting.extend(files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment