Created
January 22, 2013 14:13
-
-
Save sehmaschine/4594929 to your computer and use it in GitHub Desktop.
FileBrowser ... updated walk for FileSubmit with SEARCH_TRAVERSE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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