We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b580a5 commit 192b2eaCopy full SHA for 192b2ea
zcollection/fs_utils.py
@@ -90,16 +90,12 @@ def fs_walk(
90
yield '', [], []
91
return
92
93
- for info in listing:
+ for is_dir, name in ((info['type'] == 'directory', info['name'])
94
+ for info in listing):
95
# each info name must be at least [path]/part , but here
96
# we check also for names like [path]/part/
- pathname: str = info['name'].rstrip(SEPARATOR)
97
- name: str = pathname.rsplit(SEPARATOR, 1)[-1]
98
- if info['type'] == 'directory' and pathname != path:
99
- # do not include "self" path
100
- dirs.append(pathname)
101
- else:
102
- files.append(name)
+ dirs.append(name) if is_dir else files.append(
+ name.rsplit(SEPARATOR, 1)[-1])
103
104
def sort_sequence(sequence: list[str]) -> list[str]:
105
"""Sort the sequence if the user wishes."""
0 commit comments