now legacy
This commit is contained in:
27
horsy.py
27
horsy.py
@@ -46,7 +46,7 @@ except:
|
||||
print('Horsy may be not installed correctly. Please reinstall it or stop other horsy instances. '
|
||||
'If you installed it just now, please restart PC.')
|
||||
|
||||
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:
|
||||
from ezzdl.download import dl
|
||||
import urllib.request
|
||||
print('New version available!')
|
||||
@@ -55,12 +55,12 @@ if int(request.get('https://github.com/horsy-ml/horsy/raw/master/web_vars/versio
|
||||
print('Please wait...')
|
||||
os.rename(horsy_vars.horsypath + "horsy.exe", horsy_vars.horsypath + "horsy.old")
|
||||
print('Renamed horsy.exe to horsy.old')
|
||||
dl(['https://github.com/horsy-ml/horsy/raw/master/bin/horsy.exe',
|
||||
'https://github.com/horsy-ml/horsy/raw/master/bin/horsygui.exe']
|
||||
dl(['https://github.com/horsy-ml/legacy/raw/master/bin/horsy.exe',
|
||||
'https://github.com/horsy-ml/legacy/raw/master/bin/horsygui.exe']
|
||||
if os.path.isfile(horsy_vars.horsypath + 'horsygui.exe') else
|
||||
['https://github.com/horsy-ml/horsy/raw/master/bin/horsy.exe'],
|
||||
['https://github.com/horsy-ml/legacy/raw/master/bin/horsy.exe'],
|
||||
horsy_vars.horsypath)
|
||||
urllib.request.urlretrieve("https://github.com/horsy-ml/horsy/raw/master/web_vars/version",
|
||||
urllib.request.urlretrieve("https://github.com/horsy-ml/legacy/raw/master/web_vars/version",
|
||||
horsy_vars.horsypath + '/apps/version')
|
||||
subprocess.Popen(str(horsy_vars.horsypath + 'horsy.exe'), shell=True, close_fds=True)
|
||||
sys.exit(0)
|
||||
@@ -73,14 +73,15 @@ isNoArgs = False
|
||||
def log_logo():
|
||||
cls()
|
||||
print('''
|
||||
__ __ _______ ______ _______ __ __
|
||||
| | | || || _ | | || | | |
|
||||
| |_| || _ || | || | _____|| |_| |
|
||||
| || | | || |_||_ | |_____ | |
|
||||
| || |_| || __ ||_____ ||_ _|
|
||||
| _ || || | | | _____| | | |
|
||||
|__| |__||_______||___| |_||_______| |___|
|
||||
Search powered by Algolia
|
||||
___ _______ _______ _______ _______ __ __
|
||||
| | | || || _ || || | | |
|
||||
| | | ___|| ___|| |_| || || |_| |
|
||||
| | | |___ | | __ | || || |
|
||||
| |___ | ___|| || || || _||_ _|
|
||||
| || |___ | |_| || _ || |_ | |
|
||||
|_______||_______||_______||__| |__||_______| |___|
|
||||
Search powered by Algolia
|
||||
Get the latest acryl version at horsy.ml
|
||||
''')
|
||||
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ class Ui_MainWindow(object):
|
||||
self.horsy_text_lefttop = QtWidgets.QLabel(self.centralwidget)
|
||||
self.horsy_text_lefttop.setGeometry(QtCore.QRect(50, 10, 231, 30))
|
||||
self.horsy_text_lefttop.setStyleSheet("color: white;\n"
|
||||
"font: 20pt \"MS Shell Dlg 2\";\n"
|
||||
"font: 18pt \"MS Shell Dlg 2\";\n"
|
||||
"background: none;")
|
||||
self.horsy_text_lefttop.setObjectName("horsy_text_lefttop")
|
||||
self.path_message = QtWidgets.QTextBrowser(self.centralwidget)
|
||||
@@ -135,10 +135,10 @@ class Ui_MainWindow(object):
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "horsy - installation"))
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "horsy legacy - installation"))
|
||||
self.path_box.setPlaceholderText(_translate("MainWindow", "Installation folder, apps will be stored here"))
|
||||
self.choose_path_button.setText(_translate("MainWindow", "Choose path"))
|
||||
self.horsy_text_lefttop.setText(_translate("MainWindow", "horsy - installation"))
|
||||
self.horsy_text_lefttop.setText(_translate("MainWindow", "hlegacy - installation"))
|
||||
self.path_message.setHtml(_translate("MainWindow",
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
@@ -185,12 +185,12 @@ def install():
|
||||
threads = list()
|
||||
ui.logs_box.append("Adding task to download horsy")
|
||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
||||
args=("https://github.com/horsy-ml/horsy/raw/master/bin/horsy.exe",
|
||||
args=("https://github.com/horsy-ml/legacy/raw/master/bin/horsy.exe",
|
||||
os.path.join(path_to_install) + '/horsy.exe'), ))
|
||||
if ui.install_gui_check.isChecked():
|
||||
ui.logs_box.append("Adding task to download horsygui")
|
||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
||||
args=("https://github.com/horsy-ml/horsy/raw/master/bin/horsygui.exe",
|
||||
args=("https://github.com/horsy-ml/legacy/raw/master/bin/horsygui.exe",
|
||||
os.path.join(path_to_install) + '/horsygui.exe'), ))
|
||||
try:
|
||||
ui.logs_box.append("Starting tasks")
|
||||
@@ -204,7 +204,7 @@ def install():
|
||||
add_var(path_to_install)
|
||||
add_to_path(os.path.join(path_to_install))
|
||||
ui.logs_box.append("Downloading version file")
|
||||
urllib.request.urlretrieve("https://github.com/horsy-ml/horsy/raw/master/web_vars/version",
|
||||
urllib.request.urlretrieve("https://github.com/horsy-ml/legacy/raw/master/web_vars/version",
|
||||
os.path.join(path_to_install) + '/apps/version')
|
||||
ui.logs_box.append("Version specified")
|
||||
|
||||
@@ -215,7 +215,7 @@ def install():
|
||||
if ui.install_gui_check.isChecked():
|
||||
ui.logs_box.append("Creating shortcuts")
|
||||
desktop = winshell.desktop()
|
||||
path = os.path.join(desktop, "horsy GUI.lnk")
|
||||
path = os.path.join(desktop, "horsy legacy GUI.lnk")
|
||||
target = os.path.join(path_to_install) + '/horsygui.exe'
|
||||
wDir = os.path.join(path_to_install)
|
||||
icon = os.path.join(path_to_install) + '/horsygui.exe'
|
||||
|
||||
@@ -28,11 +28,11 @@ def install():
|
||||
threads = list()
|
||||
print("Adding task to download horsy")
|
||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
||||
args=("https://github.com/horsy-ml/horsy/raw/master/bin/horsy.exe",
|
||||
args=("https://github.com/horsy-ml/legacy/raw/master/bin/horsy.exe",
|
||||
os.path.join(path_to_install) + '/horsy.exe'), ))
|
||||
print("Adding task to download horsygui")
|
||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
||||
args=("https://github.com/horsy-ml/horsy/raw/master/bin/horsygui.exe",
|
||||
args=("https://github.com/horsy-ml/legacy/raw/master/bin/horsygui.exe",
|
||||
os.path.join(path_to_install) + '/horsygui.exe'), ))
|
||||
try:
|
||||
print("Starting tasks")
|
||||
@@ -46,7 +46,7 @@ def install():
|
||||
add_var(path_to_install)
|
||||
add_to_path(os.path.join(path_to_install))
|
||||
print("Downloading version file")
|
||||
urllib.request.urlretrieve("https://github.com/horsy-ml/horsy/raw/master/web_vars/version",
|
||||
urllib.request.urlretrieve("https://github.com/horsy-ml/legacy/raw/master/web_vars/version",
|
||||
os.path.join(path_to_install) + '/apps/version')
|
||||
print("Version specified")
|
||||
|
||||
@@ -56,7 +56,7 @@ def install():
|
||||
print("Downloading finished")
|
||||
print("Creating shortcuts")
|
||||
desktop = winshell.desktop()
|
||||
path = os.path.join(desktop, "horsy GUI.lnk")
|
||||
path = os.path.join(desktop, "horsy legacy GUI.lnk")
|
||||
target = os.path.join(path_to_install) + '/horsygui.exe'
|
||||
wDir = os.path.join(path_to_install)
|
||||
icon = os.path.join(path_to_install) + '/horsygui.exe'
|
||||
|
||||
@@ -19,11 +19,11 @@ if not os.path.exists(path_to_install + "\\apps"):
|
||||
os.makedirs(path_to_install + "\\apps")
|
||||
threads = list()
|
||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
||||
args=("https://github.com/horsy-ml/horsy/raw/master/bin/horsy.exe",
|
||||
args=("https://github.com/horsy-ml/legacy/raw/master/bin/horsy.exe",
|
||||
os.path.join(path_to_install) + '/horsy.exe'), ))
|
||||
if os.path.exists(path_to_install + '/horsygui.exe'):
|
||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
||||
args=("https://github.com/horsy-ml/horsy/raw/master/bin/horsygui.exe",
|
||||
args=("https://github.com/horsy-ml/legacy/raw/master/bin/horsygui.exe",
|
||||
os.path.join(path_to_install) + '/horsygui.exe'), ))
|
||||
try:
|
||||
for thread in threads:
|
||||
@@ -32,7 +32,7 @@ except:
|
||||
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1)
|
||||
sys.exit()
|
||||
|
||||
urllib.request.urlretrieve("https://github.com/horsy-ml/horsy/raw/master/web_vars/version",
|
||||
urllib.request.urlretrieve("https://github.com/horsy-ml/legacy/raw/master/web_vars/version",
|
||||
os.path.join(path_to_install) + '/apps/version')
|
||||
|
||||
for thread in threads:
|
||||
|
||||
10
horsygui.py
10
horsygui.py
@@ -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)
|
||||
|
||||
@@ -388,7 +388,7 @@ class Ui_MainWindow(object):
|
||||
self.horsy_text_lefttop = QtWidgets.QLabel(self.centralwidget)
|
||||
self.horsy_text_lefttop.setGeometry(QtCore.QRect(70, 10, 65, 30))
|
||||
self.horsy_text_lefttop.setStyleSheet("color: white;\n"
|
||||
"font: 20pt \"MS Shell Dlg 2\";\n"
|
||||
"font: 17pt \"MS Shell Dlg 2\";\n"
|
||||
"background: none;")
|
||||
self.horsy_text_lefttop.setObjectName("horsy_text_lefttop")
|
||||
self.tabWidget.raise_()
|
||||
@@ -403,7 +403,7 @@ class Ui_MainWindow(object):
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "horsy"))
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "horsy legacy"))
|
||||
self.loginlogout_button.setText(_translate("MainWindow", "Log in/Log out"))
|
||||
self.username_box.setPlaceholderText(_translate("MainWindow", "Log in first"))
|
||||
self.changeemail_button.setText(_translate("MainWindow", "Change e-mail"))
|
||||
@@ -479,7 +479,7 @@ class Ui_MainWindow(object):
|
||||
self.installed_table.setSortingEnabled(False)
|
||||
self.installed_table.setSortingEnabled(__sortingEnabled)
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.installed_tab), _translate("MainWindow", "Installed"))
|
||||
self.horsy_text_lefttop.setText(_translate("MainWindow", "horsy"))
|
||||
self.horsy_text_lefttop.setText(_translate("MainWindow", "legacy"))
|
||||
|
||||
|
||||
class Ui_LoginWindow(object):
|
||||
|
||||
@@ -7,4 +7,5 @@ algoliasearch
|
||||
PyQt5
|
||||
easygui
|
||||
winshell
|
||||
ezzdl
|
||||
ezzdl
|
||||
pywin32
|
||||
Reference in New Issue
Block a user