[Update] アップデート時専用の表示を追加。※失敗した時の処理など、改良の余地あり。

This commit is contained in:
Sakamoto Shiina
2024-04-17 15:44:14 +09:00
parent 3413f6e498
commit 680ca8a955
11 changed files with 192 additions and 5 deletions

View File

@@ -277,7 +277,7 @@ class Model:
file.write(chunk)
total_chunk += len(chunk)
if isinstance(func, Callable):
func(total_chunk/file_size)
func(progress=total_chunk/file_size, progress_type="downloading")
print(f"downloaded {total_chunk}/{file_size}")
with ZipFile(os_path.join(tmp_path, filename)) as zf:
@@ -287,7 +287,7 @@ class Model:
extracted_files += 1
zf.extract(file_info, os_path.join(current_directory, tmp_directory_name))
if isinstance(func, Callable):
func(extracted_files / total_files)
func(progress=extracted_files/total_files, progress_type="extracting")
print(f"extracted {extracted_files}/{total_files}")
copyfile(os_path.join(current_directory, folder_name, "batch", batch_name), os_path.join(current_directory, batch_name))