Spaces:
Runtime error
Runtime error
feat(toolbox): 支持rar格式与7z格式解压,修改了下注释
Browse files- config.py +1 -0
- toolbox.py +2 -0
config.py
CHANGED
@@ -14,6 +14,7 @@ if USE_PROXY:
|
|
14 |
|
15 |
# 代理网络的地址,打开你的科学上网软件查看代理的协议(socks5/http)、地址(localhost)和端口(11284)
|
16 |
proxies = { "http": "socks5h://localhost:11284", "https": "socks5h://localhost:11284", }
|
|
|
17 |
print('网络代理状态:运行。')
|
18 |
else:
|
19 |
proxies = None
|
|
|
14 |
|
15 |
# 代理网络的地址,打开你的科学上网软件查看代理的协议(socks5/http)、地址(localhost)和端口(11284)
|
16 |
proxies = { "http": "socks5h://localhost:11284", "https": "socks5h://localhost:11284", }
|
17 |
+
|
18 |
print('网络代理状态:运行。')
|
19 |
else:
|
20 |
proxies = None
|
toolbox.py
CHANGED
@@ -193,11 +193,13 @@ def extract_archive(file_path, dest_dir):
|
|
193 |
print("Successfully extracted rar archive to {}".format(dest_dir))
|
194 |
except:
|
195 |
print("rar格式需要安装额外依赖")
|
|
|
196 |
elif file_extension == '.7z':
|
197 |
try:
|
198 |
import py7zr
|
199 |
with py7zr.SevenZipFile(file_path, mode='r') as f:
|
200 |
f.extractall(path=dest_dir)
|
|
|
201 |
except:
|
202 |
print("7z格式需要安装额外依赖")
|
203 |
else:
|
|
|
193 |
print("Successfully extracted rar archive to {}".format(dest_dir))
|
194 |
except:
|
195 |
print("rar格式需要安装额外依赖")
|
196 |
+
|
197 |
elif file_extension == '.7z':
|
198 |
try:
|
199 |
import py7zr
|
200 |
with py7zr.SevenZipFile(file_path, mode='r') as f:
|
201 |
f.extractall(path=dest_dir)
|
202 |
+
print("Successfully extracted 7z archive to {}".format(dest_dir))
|
203 |
except:
|
204 |
print("7z格式需要安装额外依赖")
|
205 |
else:
|