Spaces:
Sleeping
Sleeping
Update check_proxy.py
Browse files- check_proxy.py +9 -14
check_proxy.py
CHANGED
@@ -127,20 +127,15 @@ def auto_update(raise_error=False):
|
|
127 |
from colorful import print亮黄
|
128 |
print亮黄(f'\n新版本可用。新版本:{remote_version},当前版本:{current_version}。{new_feature}')
|
129 |
print('(1)Github更新地址:\nhttps://github.com/binary-husky/chatgpt_academic\n')
|
130 |
-
|
131 |
-
|
132 |
-
path
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
msg += trimmed_format_exc()
|
140 |
-
print(msg)
|
141 |
-
else:
|
142 |
-
print('自动更新程序:已禁用')
|
143 |
-
return
|
144 |
else:
|
145 |
return
|
146 |
except:
|
|
|
127 |
from colorful import print亮黄
|
128 |
print亮黄(f'\n新版本可用。新版本:{remote_version},当前版本:{current_version}。{new_feature}')
|
129 |
print('(1)Github更新地址:\nhttps://github.com/binary-husky/chatgpt_academic\n')
|
130 |
+
path = backup_and_download(current_version, remote_version)
|
131 |
+
try:
|
132 |
+
patch_and_restart(path)
|
133 |
+
except:
|
134 |
+
msg = '更新失败。'
|
135 |
+
if raise_error:
|
136 |
+
from toolbox import trimmed_format_exc
|
137 |
+
msg += trimmed_format_exc()
|
138 |
+
print(msg)
|
|
|
|
|
|
|
|
|
|
|
139 |
else:
|
140 |
return
|
141 |
except:
|