后端下载进度条打印

This commit is contained in:
hjdhnx 2023-11-18 16:09:00 +08:00
parent 8c10762705
commit 59c5ed245f
3 changed files with 9 additions and 2 deletions

View File

@ -1 +1 @@
3.9.48beta27
3.9.48beta28

View File

@ -164,6 +164,11 @@ def file_downloads(files, save_path='download'):
logger.info(
"\n{} file{} download successfully, {} file{} download failed!".format(sn, 's' * (sn > 1), fn, 's' * (fn > 1)))
if fn > 0:
return False
else:
return True
if __name__ == '__main__':
# urlTxt = 'download/urls.txt'

View File

@ -226,7 +226,9 @@ def download_new_version(update_proxy='https://ghproxy.liuzhicong.com/'):
# f.write(rb)
# 2023/11/18 改为带进度条的下载
file_downloads([{'url': url, 'name': 'dr_py.zip'}], tmp_path)
download_ok = file_downloads([{'url': url, 'name': 'dr_py.zip'}], tmp_path)
if not download_ok:
return '带进度条的下载升级文件失败。具体参考后台日志'
# print(f'开始解压文件:{download_path}')
logger.info(f'开始解压文件:{download_path}')