compress update

This commit is contained in:
13339479676 2022-01-20 09:24:51 +08:00
parent 1d5d56a19f
commit f4c7541b1f
1 changed files with 6 additions and 2 deletions

View File

@ -32,13 +32,17 @@ def webcam_compress(compressStyle, is_autoCompressName, compressName, preCompres
# zip压缩
compress_file = zipfile.ZipFile(compressName, compressMode)
for i in range(len(file_list)):
compressing_file = f'{preCompressFilePath}/{file_list[i]}'
# print(f'正在压缩:{compressing_file}')
compress_file.write(
f'{preCompressFilePath}/{file_list[i]}', compress_type=zipfile.ZIP_DEFLATED)
compressing_file, compress_type=zipfile.ZIP_DEFLATED)
if (compressStyle == COMPRESS_SUFFIX[1]):
# tar压缩
compress_file = tarfile.open(compressName, compressMode)
for i in range(len(file_list)):
compress_file.add(f'{preCompressFilePath}/{file_list[i]}')
compressing_file = f'{preCompressFilePath}/{file_list[i]}'
# print(f'正在压缩:{compressing_file}')
compress_file.add(compressing_file)
# ----------压缩结束----------
compress_file.close()