Exemple #1
0
 def walk(directory, parent_path):
     for path in directory["contents"].keys():
         full_path = path_join(parent_path, path)
         if directory["contents"][path]["type"] == "dir":
             directory["contents"][path] = callback(full_path, directory["contents"][path]) or \
                      directory["contents"][path]
             walk(directory["contents"][path], full_path)
         else:
             directory["contents"][path] = callback(full_path, directory["contents"][path]) or \
                      directory["contents"][path]
Exemple #2
0
 def walk(directory, parent_path):
     for path in directory["contents"].keys():
         full_path = path_join(parent_path, path)
         if directory["contents"][path]["type"] == "dir":
             directory["contents"][path] = callback(full_path, directory["contents"][path]) or \
                      directory["contents"][path]
             walk(directory["contents"][path], full_path)
         else:
             directory["contents"][path] = callback(full_path, directory["contents"][path]) or \
                      directory["contents"][path]