Spaces:
Sleeping
Sleeping
Update check_proxy.py
Browse files- check_proxy.py +14 -15
check_proxy.py
CHANGED
@@ -123,21 +123,20 @@ def auto_update(raise_error=False):
|
|
123 |
with open('./version', 'r', encoding='utf8') as f:
|
124 |
current_version = f.read()
|
125 |
current_version = json.loads(current_version)['version']
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
print(
|
139 |
-
|
140 |
-
return
|
141 |
except:
|
142 |
msg = '自动更新程序:已禁用。建议排查:代理网络配置。'
|
143 |
if raise_error:
|
|
|
123 |
with open('./version', 'r', encoding='utf8') as f:
|
124 |
current_version = f.read()
|
125 |
current_version = json.loads(current_version)['version']
|
126 |
+
user_instruction = input('(2)是否一键更新代码(Y+回车=确认,输入其他/无输入+回车=不更新)?')
|
127 |
+
if user_instruction in ['Y', 'y']:
|
128 |
+
path = backup_and_download(current_version, remote_version)
|
129 |
+
try:
|
130 |
+
patch_and_restart(path)
|
131 |
+
except:
|
132 |
+
msg = '更新失败。'
|
133 |
+
if raise_error:
|
134 |
+
from toolbox import trimmed_format_exc
|
135 |
+
msg += trimmed_format_exc()
|
136 |
+
print(msg)
|
137 |
+
else:
|
138 |
+
print('自动更新程序:已禁用')
|
139 |
+
return
|
|
|
140 |
except:
|
141 |
msg = '自动更新程序:已禁用。建议排查:代理网络配置。'
|
142 |
if raise_error:
|