def relative_iterdir(self, relpath=''):
relpath = self._as_zip_path(relpath)
seen = set()
with zipfile.ZipFile(str(self.path), mode='r') as zf:
for name in zf.namelist():
if name.startswith(relpath):
parts = pathlib.PurePosixPath(name).parts
if len(parts) > 0:
result = parts[0]
if result not in seen:
seen.add(result)
yield result
评论列表
文章目录