From 5381df8f359ad9efeaecf1d92fe102263d647371 Mon Sep 17 00:00:00 2001 From: JasonGuo1 <1515893624@qq.com> Date: Thu, 30 Mar 2023 15:45:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(toolbox):=20=E6=94=AF=E6=8C=81rar=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=B8=8E7z=E6=A0=BC=E5=BC=8F=E8=A7=A3=E5=8E=8B?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=8B=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 1 + toolbox.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/config.py b/config.py index a513f44..b445fa7 100644 --- a/config.py +++ b/config.py @@ -14,6 +14,7 @@ if USE_PROXY: # 代理网络的地址,打开你的科学上网软件查看代理的协议(socks5/http)、地址(localhost)和端口(11284) proxies = { "http": "socks5h://localhost:11284", "https": "socks5h://localhost:11284", } + print('网络代理状态:运行。') else: proxies = None diff --git a/toolbox.py b/toolbox.py index 899cca4..43fafd3 100644 --- a/toolbox.py +++ b/toolbox.py @@ -193,11 +193,13 @@ def extract_archive(file_path, dest_dir): print("Successfully extracted rar archive to {}".format(dest_dir)) except: print("rar格式需要安装额外依赖") + elif file_extension == '.7z': try: import py7zr with py7zr.SevenZipFile(file_path, mode='r') as f: f.extractall(path=dest_dir) + print("Successfully extracted 7z archive to {}".format(dest_dir)) except: print("7z格式需要安装额外依赖") else: