Final refactor
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user