rtzip 0.2.1__tar.gz → 0.2.2__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.
- rtzip-0.2.2/LICENSE +28 -0
- {rtzip-0.2.1 → rtzip-0.2.2}/PKG-INFO +3 -1
- {rtzip-0.2.1 → rtzip-0.2.2}/pyproject.toml +1 -1
- {rtzip-0.2.1 → rtzip-0.2.2}/src/rtzip/remotezip.py +6 -6
- {rtzip-0.2.1 → rtzip-0.2.2}/src/rtzip.egg-info/PKG-INFO +3 -1
- {rtzip-0.2.1 → rtzip-0.2.2}/src/rtzip.egg-info/SOURCES.txt +1 -0
- {rtzip-0.2.1 → rtzip-0.2.2}/README.md +0 -0
- {rtzip-0.2.1 → rtzip-0.2.2}/setup.cfg +0 -0
- {rtzip-0.2.1 → rtzip-0.2.2}/src/rtzip/__init__.py +0 -0
- {rtzip-0.2.1 → rtzip-0.2.2}/src/rtzip/const.py +0 -0
- {rtzip-0.2.1 → rtzip-0.2.2}/src/rtzip/errors.py +0 -0
- {rtzip-0.2.1 → rtzip-0.2.2}/src/rtzip/models.py +0 -0
- {rtzip-0.2.1 → rtzip-0.2.2}/src/rtzip/utils.py +0 -0
- {rtzip-0.2.1 → rtzip-0.2.2}/src/rtzip.egg-info/dependency_links.txt +0 -0
- {rtzip-0.2.1 → rtzip-0.2.2}/src/rtzip.egg-info/requires.txt +0 -0
- {rtzip-0.2.1 → rtzip-0.2.2}/src/rtzip.egg-info/top_level.txt +0 -0
rtzip-0.2.2/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, LittleNightSong
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -63,7 +63,7 @@ class RemoteZip:
|
|
|
63
63
|
|
|
64
64
|
self.cd_info: EOCD | Zip64EOCD | None = None
|
|
65
65
|
self.files: list[CDEntry] = []
|
|
66
|
-
self.file_mapping: dict[
|
|
66
|
+
self.file_mapping: dict[bytes, CDEntry] | None = None
|
|
67
67
|
|
|
68
68
|
self.is_zip64 = False
|
|
69
69
|
|
|
@@ -193,7 +193,7 @@ class RemoteZip:
|
|
|
193
193
|
try:
|
|
194
194
|
consume_entry()
|
|
195
195
|
except (struct.error, AssertionError):
|
|
196
|
-
|
|
196
|
+
break
|
|
197
197
|
|
|
198
198
|
if buffer and not ignore_extra:
|
|
199
199
|
# print("Read Entries: ", len(files))
|
|
@@ -249,7 +249,7 @@ class RemoteZip:
|
|
|
249
249
|
|
|
250
250
|
return m
|
|
251
251
|
|
|
252
|
-
def find_file_entry(self, filename):
|
|
252
|
+
def find_file_entry(self, filename: bytes):
|
|
253
253
|
"""
|
|
254
254
|
从本地已有的数据获取 filename 对应的 CDEntry 对象
|
|
255
255
|
|
|
@@ -270,7 +270,7 @@ class RemoteZip:
|
|
|
270
270
|
else:
|
|
271
271
|
raise FileNotFoundError(filename)
|
|
272
272
|
|
|
273
|
-
async def _stream_single_file(self, filename):
|
|
273
|
+
async def _stream_single_file(self, filename: bytes):
|
|
274
274
|
entry = self.find_file_entry(filename)
|
|
275
275
|
|
|
276
276
|
if entry.is_encrypted:
|
|
@@ -297,7 +297,7 @@ class RemoteZip:
|
|
|
297
297
|
case 0x0008:
|
|
298
298
|
return deflate_wrapper(raw_generator)
|
|
299
299
|
|
|
300
|
-
async def stream_single_file(self, filename):
|
|
300
|
+
async def stream_single_file(self, filename: bytes):
|
|
301
301
|
"""
|
|
302
302
|
流式读取一个压缩包内的文件
|
|
303
303
|
|
|
@@ -308,7 +308,7 @@ class RemoteZip:
|
|
|
308
308
|
async for i in gen:
|
|
309
309
|
yield i
|
|
310
310
|
|
|
311
|
-
async def load_single_file(self, filename) -> bytearray:
|
|
311
|
+
async def load_single_file(self, filename: bytes) -> bytearray:
|
|
312
312
|
"""
|
|
313
313
|
直接加载文件的内容
|
|
314
314
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|