Final refactor

This commit is contained in:
BarsTiger
2022-02-06 16:57:10 +02:00
parent be4c49ecf3
commit 46b5329318
7 changed files with 15 additions and 14 deletions

View File

@@ -227,18 +227,18 @@ if __name__ == "__main__":
except:
gui.popup('Error', 'Horsy may be not installed correctly. Please reinstall it.')
version = int(f.read())
if int(requests.get('https://github.com/BarsTiger/horsy/raw/master/web_vars/version').text) > version:
if int(requests.get('https://github.com/horsy-ml/horsy/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.')
try:
with open(os.path.join(horsy_vars.horsypath) + '/horsy_updater.exe', 'wb') as f:
f.write(requests.get('https://github.com/BarsTiger/horsy/raw/master/bin/horsy_updater.exe').content)
f.write(requests.get('https://github.com/horsy-ml/horsy/raw/master/bin/horsy_updater.exe').content)
except:
gui.popup('Error', 'Could not download updater. \nMaybe installation folder is not writable '
'(only for admins).\n Please reinstall horsy or update it manually. \n'
'Click OK, download file that will open browser and launch it.\n'
'Afterwards, delete updater file and launch horsy again.')
webbrowser.open('https://github.com/BarsTiger/horsy/raw/master/bin/horsy_updater.exe')
webbrowser.open('https://github.com/horsy-ml/horsy/raw/master/bin/horsy_updater.exe')
UiMainWindow.close()
os.system('horsy_updater.exe horsygui')
sys.exit()