now legacy
This commit is contained in:
25
horsy.py
25
horsy.py
@@ -46,7 +46,7 @@ except:
|
|||||||
print('Horsy may be not installed correctly. Please reinstall it or stop other horsy instances. '
|
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 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
|
from ezzdl.download import dl
|
||||||
import urllib.request
|
import urllib.request
|
||||||
print('New version available!')
|
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...')
|
print('Please wait...')
|
||||||
os.rename(horsy_vars.horsypath + "horsy.exe", horsy_vars.horsypath + "horsy.old")
|
os.rename(horsy_vars.horsypath + "horsy.exe", horsy_vars.horsypath + "horsy.old")
|
||||||
print('Renamed horsy.exe to horsy.old')
|
print('Renamed horsy.exe to horsy.old')
|
||||||
dl(['https://github.com/horsy-ml/horsy/raw/master/bin/horsy.exe',
|
dl(['https://github.com/horsy-ml/legacy/raw/master/bin/horsy.exe',
|
||||||
'https://github.com/horsy-ml/horsy/raw/master/bin/horsygui.exe']
|
'https://github.com/horsy-ml/legacy/raw/master/bin/horsygui.exe']
|
||||||
if os.path.isfile(horsy_vars.horsypath + 'horsygui.exe') else
|
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)
|
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')
|
horsy_vars.horsypath + '/apps/version')
|
||||||
subprocess.Popen(str(horsy_vars.horsypath + 'horsy.exe'), shell=True, close_fds=True)
|
subprocess.Popen(str(horsy_vars.horsypath + 'horsy.exe'), shell=True, close_fds=True)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
@@ -73,14 +73,15 @@ isNoArgs = False
|
|||||||
def log_logo():
|
def log_logo():
|
||||||
cls()
|
cls()
|
||||||
print('''
|
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 = QtWidgets.QLabel(self.centralwidget)
|
||||||
self.horsy_text_lefttop.setGeometry(QtCore.QRect(50, 10, 231, 30))
|
self.horsy_text_lefttop.setGeometry(QtCore.QRect(50, 10, 231, 30))
|
||||||
self.horsy_text_lefttop.setStyleSheet("color: white;\n"
|
self.horsy_text_lefttop.setStyleSheet("color: white;\n"
|
||||||
"font: 20pt \"MS Shell Dlg 2\";\n"
|
"font: 18pt \"MS Shell Dlg 2\";\n"
|
||||||
"background: none;")
|
"background: none;")
|
||||||
self.horsy_text_lefttop.setObjectName("horsy_text_lefttop")
|
self.horsy_text_lefttop.setObjectName("horsy_text_lefttop")
|
||||||
self.path_message = QtWidgets.QTextBrowser(self.centralwidget)
|
self.path_message = QtWidgets.QTextBrowser(self.centralwidget)
|
||||||
@@ -135,10 +135,10 @@ class Ui_MainWindow(object):
|
|||||||
|
|
||||||
def retranslateUi(self, MainWindow):
|
def retranslateUi(self, MainWindow):
|
||||||
_translate = QtCore.QCoreApplication.translate
|
_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.path_box.setPlaceholderText(_translate("MainWindow", "Installation folder, apps will be stored here"))
|
||||||
self.choose_path_button.setText(_translate("MainWindow", "Choose path"))
|
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",
|
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"
|
"<!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"
|
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||||
@@ -185,12 +185,12 @@ def install():
|
|||||||
threads = list()
|
threads = list()
|
||||||
ui.logs_box.append("Adding task to download horsy")
|
ui.logs_box.append("Adding task to download horsy")
|
||||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
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'), ))
|
os.path.join(path_to_install) + '/horsy.exe'), ))
|
||||||
if ui.install_gui_check.isChecked():
|
if ui.install_gui_check.isChecked():
|
||||||
ui.logs_box.append("Adding task to download horsygui")
|
ui.logs_box.append("Adding task to download horsygui")
|
||||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
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'), ))
|
os.path.join(path_to_install) + '/horsygui.exe'), ))
|
||||||
try:
|
try:
|
||||||
ui.logs_box.append("Starting tasks")
|
ui.logs_box.append("Starting tasks")
|
||||||
@@ -204,7 +204,7 @@ def install():
|
|||||||
add_var(path_to_install)
|
add_var(path_to_install)
|
||||||
add_to_path(os.path.join(path_to_install))
|
add_to_path(os.path.join(path_to_install))
|
||||||
ui.logs_box.append("Downloading version file")
|
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')
|
os.path.join(path_to_install) + '/apps/version')
|
||||||
ui.logs_box.append("Version specified")
|
ui.logs_box.append("Version specified")
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ def install():
|
|||||||
if ui.install_gui_check.isChecked():
|
if ui.install_gui_check.isChecked():
|
||||||
ui.logs_box.append("Creating shortcuts")
|
ui.logs_box.append("Creating shortcuts")
|
||||||
desktop = winshell.desktop()
|
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'
|
target = os.path.join(path_to_install) + '/horsygui.exe'
|
||||||
wDir = os.path.join(path_to_install)
|
wDir = os.path.join(path_to_install)
|
||||||
icon = os.path.join(path_to_install) + '/horsygui.exe'
|
icon = os.path.join(path_to_install) + '/horsygui.exe'
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ def install():
|
|||||||
threads = list()
|
threads = list()
|
||||||
print("Adding task to download horsy")
|
print("Adding task to download horsy")
|
||||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
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'), ))
|
os.path.join(path_to_install) + '/horsy.exe'), ))
|
||||||
print("Adding task to download horsygui")
|
print("Adding task to download horsygui")
|
||||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
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'), ))
|
os.path.join(path_to_install) + '/horsygui.exe'), ))
|
||||||
try:
|
try:
|
||||||
print("Starting tasks")
|
print("Starting tasks")
|
||||||
@@ -46,7 +46,7 @@ def install():
|
|||||||
add_var(path_to_install)
|
add_var(path_to_install)
|
||||||
add_to_path(os.path.join(path_to_install))
|
add_to_path(os.path.join(path_to_install))
|
||||||
print("Downloading version file")
|
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')
|
os.path.join(path_to_install) + '/apps/version')
|
||||||
print("Version specified")
|
print("Version specified")
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ def install():
|
|||||||
print("Downloading finished")
|
print("Downloading finished")
|
||||||
print("Creating shortcuts")
|
print("Creating shortcuts")
|
||||||
desktop = winshell.desktop()
|
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'
|
target = os.path.join(path_to_install) + '/horsygui.exe'
|
||||||
wDir = os.path.join(path_to_install)
|
wDir = os.path.join(path_to_install)
|
||||||
icon = os.path.join(path_to_install) + '/horsygui.exe'
|
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")
|
os.makedirs(path_to_install + "\\apps")
|
||||||
threads = list()
|
threads = list()
|
||||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
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'), ))
|
os.path.join(path_to_install) + '/horsy.exe'), ))
|
||||||
if os.path.exists(path_to_install + '/horsygui.exe'):
|
if os.path.exists(path_to_install + '/horsygui.exe'):
|
||||||
threads.append(threading.Thread(target=urllib.request.urlretrieve,
|
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'), ))
|
os.path.join(path_to_install) + '/horsygui.exe'), ))
|
||||||
try:
|
try:
|
||||||
for thread in threads:
|
for thread in threads:
|
||||||
@@ -32,7 +32,7 @@ except:
|
|||||||
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1)
|
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1)
|
||||||
sys.exit()
|
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')
|
os.path.join(path_to_install) + '/apps/version')
|
||||||
|
|
||||||
for thread in threads:
|
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 '
|
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.')
|
'running. If you installed it just now, please restart PC.')
|
||||||
version = int(f.read())
|
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.'
|
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'
|
'\nPress OK and updater will download the latest version.\n'
|
||||||
'If you see this message again, or horsy doesn\'t launch, \n'
|
'If you see this message again, or horsy doesn\'t launch, \n'
|
||||||
@@ -349,10 +349,10 @@ if __name__ == "__main__":
|
|||||||
UiMainWindow.close()
|
UiMainWindow.close()
|
||||||
os.rename(horsy_vars.horsypath + "horsygui.exe", horsy_vars.horsypath + "horsygui.old")
|
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:
|
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:
|
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)
|
f.write(request.get('https://github.com/horsy-ml/legacy/raw/master/bin/horsy.exe').content)
|
||||||
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')
|
horsy_vars.horsypath + '/apps/version')
|
||||||
except:
|
except:
|
||||||
gui.popup('Error', 'Could not download horsy. \nMaybe installation folder is not writable '
|
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'
|
'Click OK, download file that will be opened in browser copy it to horsy \n'
|
||||||
'folder and launch it.\n'
|
'folder and launch it.\n'
|
||||||
'Afterwards, delete updater file and launch horsy again.')
|
'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)
|
subprocess.Popen(str(horsy_vars.horsypath + 'horsygui.exe'), shell=True, close_fds=True)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ class Ui_MainWindow(object):
|
|||||||
self.horsy_text_lefttop = QtWidgets.QLabel(self.centralwidget)
|
self.horsy_text_lefttop = QtWidgets.QLabel(self.centralwidget)
|
||||||
self.horsy_text_lefttop.setGeometry(QtCore.QRect(70, 10, 65, 30))
|
self.horsy_text_lefttop.setGeometry(QtCore.QRect(70, 10, 65, 30))
|
||||||
self.horsy_text_lefttop.setStyleSheet("color: white;\n"
|
self.horsy_text_lefttop.setStyleSheet("color: white;\n"
|
||||||
"font: 20pt \"MS Shell Dlg 2\";\n"
|
"font: 17pt \"MS Shell Dlg 2\";\n"
|
||||||
"background: none;")
|
"background: none;")
|
||||||
self.horsy_text_lefttop.setObjectName("horsy_text_lefttop")
|
self.horsy_text_lefttop.setObjectName("horsy_text_lefttop")
|
||||||
self.tabWidget.raise_()
|
self.tabWidget.raise_()
|
||||||
@@ -403,7 +403,7 @@ class Ui_MainWindow(object):
|
|||||||
|
|
||||||
def retranslateUi(self, MainWindow):
|
def retranslateUi(self, MainWindow):
|
||||||
_translate = QtCore.QCoreApplication.translate
|
_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.loginlogout_button.setText(_translate("MainWindow", "Log in/Log out"))
|
||||||
self.username_box.setPlaceholderText(_translate("MainWindow", "Log in first"))
|
self.username_box.setPlaceholderText(_translate("MainWindow", "Log in first"))
|
||||||
self.changeemail_button.setText(_translate("MainWindow", "Change e-mail"))
|
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(False)
|
||||||
self.installed_table.setSortingEnabled(__sortingEnabled)
|
self.installed_table.setSortingEnabled(__sortingEnabled)
|
||||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.installed_tab), _translate("MainWindow", "Installed"))
|
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):
|
class Ui_LoginWindow(object):
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ PyQt5
|
|||||||
easygui
|
easygui
|
||||||
winshell
|
winshell
|
||||||
ezzdl
|
ezzdl
|
||||||
|
pywin32
|
||||||
Reference in New Issue
Block a user