diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-04-05 02:24:41 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-04-05 02:24:41 +0000 |
| commit | fd58fd8bb6f30e5cad4fcdcf2e068a9e0e1f612d (patch) | |
| tree | d2a50f4860c5f5230c10987e2b5ed6ea81b451e0 /taskflow/examples | |
| parent | 2ad837c9b98a60110c04aa4d2859fc4a71ecccf8 (diff) | |
| parent | ce7b1d2c92e901f213f71c4c3e4d9c5f2145ff70 (diff) | |
| download | taskflow-fd58fd8bb6f30e5cad4fcdcf2e068a9e0e1f612d.tar.gz | |
Merge "Allow ls() to list recursively (using breadth-first)"
Diffstat (limited to 'taskflow/examples')
| -rw-r--r-- | taskflow/examples/dump_memory_backend.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/taskflow/examples/dump_memory_backend.py b/taskflow/examples/dump_memory_backend.py index 7209dda..2e3aee7 100644 --- a/taskflow/examples/dump_memory_backend.py +++ b/taskflow/examples/dump_memory_backend.py @@ -70,14 +70,9 @@ e.run() print("---------") print("After run") print("---------") -entries = [os.path.join(backend.memory.root_path, child) - for child in backend.memory.ls(backend.memory.root_path)] -while entries: - path = entries.pop() +for path in backend.memory.ls(backend.memory.root_path, recursive=True): value = backend.memory[path] if value: print("%s -> %s" % (path, value)) else: print("%s" % (path)) - entries.extend(os.path.join(path, child) - for child in backend.memory.ls(path)) |
