aiohttp-zip-response 2.0.2__tar.gz → 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aiohttp_zip_response-2.0.2 → aiohttp_zip_response-2.1.0}/PKG-INFO +1 -1
- {aiohttp_zip_response-2.0.2 → aiohttp_zip_response-2.1.0}/aiohttp_zip_response/zip_response.py +13 -12
- {aiohttp_zip_response-2.0.2 → aiohttp_zip_response-2.1.0}/pyproject.toml +1 -1
- {aiohttp_zip_response-2.0.2 → aiohttp_zip_response-2.1.0}/LICENSE +0 -0
- {aiohttp_zip_response-2.0.2 → aiohttp_zip_response-2.1.0}/README.md +0 -0
- {aiohttp_zip_response-2.0.2 → aiohttp_zip_response-2.1.0}/aiohttp_zip_response/__init__.py +0 -0
- {aiohttp_zip_response-2.0.2 → aiohttp_zip_response-2.1.0}/aiohttp_zip_response/py.typed +0 -0
{aiohttp_zip_response-2.0.2 → aiohttp_zip_response-2.1.0}/aiohttp_zip_response/zip_response.py
RENAMED
|
@@ -48,10 +48,8 @@ class ZipResponse(web.StreamResponse):
|
|
|
48
48
|
datetime.fromtimestamp(lstat.st_mtime),
|
|
49
49
|
lstat.st_mode,
|
|
50
50
|
ZIP_32,
|
|
51
|
-
self.
|
|
51
|
+
self.yield_symlink_member_chunks(member_path),
|
|
52
52
|
)
|
|
53
|
-
else:
|
|
54
|
-
continue
|
|
55
53
|
|
|
56
54
|
elif member_path.is_file():
|
|
57
55
|
yield (
|
|
@@ -59,7 +57,7 @@ class ZipResponse(web.StreamResponse):
|
|
|
59
57
|
datetime.fromtimestamp(lstat.st_mtime),
|
|
60
58
|
lstat.st_mode,
|
|
61
59
|
ZIP_32,
|
|
62
|
-
self.
|
|
60
|
+
self.yield_file_member_chunks(member_path),
|
|
63
61
|
)
|
|
64
62
|
|
|
65
63
|
elif member_path.is_dir():
|
|
@@ -68,20 +66,23 @@ class ZipResponse(web.StreamResponse):
|
|
|
68
66
|
datetime.fromtimestamp(lstat.st_mtime),
|
|
69
67
|
lstat.st_mode,
|
|
70
68
|
ZIP_32,
|
|
71
|
-
self.
|
|
69
|
+
self.yield_dir_member_chunks(member_path),
|
|
72
70
|
)
|
|
73
71
|
|
|
74
|
-
async def
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if path.is_dir():
|
|
80
|
-
return
|
|
72
|
+
async def yield_symlink_member_chunks(
|
|
73
|
+
self, path: Path
|
|
74
|
+
) -> AsyncGenerator[bytes, None]:
|
|
75
|
+
yield str(path.resolve().relative_to(self._base_path)).encode()
|
|
76
|
+
return
|
|
81
77
|
|
|
78
|
+
async def yield_file_member_chunks(self, path: Path) -> AsyncGenerator[bytes, None]:
|
|
82
79
|
with path.open("rb") as file:
|
|
83
80
|
while True:
|
|
84
81
|
chunk = file.read(self._chunk_size)
|
|
85
82
|
if not chunk:
|
|
86
83
|
break
|
|
87
84
|
yield chunk
|
|
85
|
+
|
|
86
|
+
async def yield_dir_member_chunks(self, path: Path) -> AsyncGenerator[bytes, None]:
|
|
87
|
+
return
|
|
88
|
+
yield b"" # pragma: no cover
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|