now legacy

This commit is contained in:
BarsTiger
2022-06-04 19:20:20 +03:00
parent f1b3cd9db1
commit 564df3ef01
7 changed files with 38 additions and 36 deletions

View File

@@ -338,7 +338,7 @@ if __name__ == "__main__":
gui.popup('Error', 'Horsy may be not installed correctly. Please reinstall it or stop another instances if '
'running. If you installed it just now, please restart PC.')
version = int(f.read())
if int(request.get('https://github.com/horsy-ml/horsy/raw/master/web_vars/version').text) > version:
if int(request.get('https://github.com/horsy-ml/legacy/raw/master/web_vars/version').text) > version:
gui.popup('Update', 'New version available! \nWe appreciate your safety, so you need to update horsy.'
'\nPress OK and updater will download the latest version.\n'
'If you see this message again, or horsy doesn\'t launch, \n'
@@ -349,10 +349,10 @@ if __name__ == "__main__":
UiMainWindow.close()
os.rename(horsy_vars.horsypath + "horsygui.exe", horsy_vars.horsypath + "horsygui.old")
with open(os.path.join(horsy_vars.horsypath) + 'horsygui.exe', 'wb') as f:
f.write(request.get('https://github.com/horsy-ml/horsy/raw/master/bin/horsygui.exe').content)
f.write(request.get('https://github.com/horsy-ml/legacy/raw/master/bin/horsygui.exe').content)
with open(os.path.join(horsy_vars.horsypath) + 'horsy.exe', 'wb') as f:
f.write(request.get('https://github.com/horsy-ml/horsy/raw/master/bin/horsy.exe').content)
urllib.request.urlretrieve("https://github.com/horsy-ml/horsy/raw/master/web_vars/version",
f.write(request.get('https://github.com/horsy-ml/legacy/raw/master/bin/horsy.exe').content)
urllib.request.urlretrieve("https://github.com/horsy-ml/legacy/raw/master/web_vars/version",
horsy_vars.horsypath + '/apps/version')
except:
gui.popup('Error', 'Could not download horsy. \nMaybe installation folder is not writable '
@@ -360,7 +360,7 @@ if __name__ == "__main__":
'Click OK, download file that will be opened in browser copy it to horsy \n'
'folder and launch it.\n'
'Afterwards, delete updater file and launch horsy again.')
webbrowser.open('https://github.com/horsy-ml/horsy/raw/master/bin/horsy_updater.exe')
webbrowser.open('https://github.com/horsy-ml/legacy/raw/master/bin/horsy_updater.exe')
subprocess.Popen(str(horsy_vars.horsypath + 'horsygui.exe'), shell=True, close_fds=True)
sys.exit(0)