JerryZhouYG commited on
Commit
bc63dff
·
verified ·
1 Parent(s): 12a6997

Update check_proxy.py

Browse files
Files changed (1) hide show
  1. check_proxy.py +7 -1
check_proxy.py CHANGED
@@ -123,7 +123,11 @@ 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
- user_instruction = input('(2)是否一键更新代码(Y+回车=确认,输入其他/无输入+回车=不更新)?')
 
 
 
 
127
  if user_instruction in ['Y', 'y']:
128
  path = backup_and_download(current_version, remote_version)
129
  try:
@@ -137,6 +141,8 @@ def auto_update(raise_error=False):
137
  else:
138
  print('自动更新程序:已禁用')
139
  return
 
 
140
  except:
141
  msg = '自动更新程序:已禁用。建议排查:代理网络配置。'
142
  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
+ if (remote_version - current_version) >= 0.01-1e-5:
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
+ user_instruction = input('(2)是否一键更新代码(Y+回车=确认,输入其他/无输入+回车=不更新)?')
131
  if user_instruction in ['Y', 'y']:
132
  path = backup_and_download(current_version, remote_version)
133
  try:
 
141
  else:
142
  print('自动更新程序:已禁用')
143
  return
144
+ else:
145
+ return
146
  except:
147
  msg = '自动更新程序:已禁用。建议排查:代理网络配置。'
148
  if raise_error: