Files
KOTIKOTappsLegacy/KOTIKOT_launcher.py
BarsTiger 8c00f26c6d 1
2021-06-01 17:14:16 +03:00

64 lines
2.5 KiB
Python

import urllib.request, os, time, sys
from subprocess import *
from PyQt5 import *
launchfolder = os.getcwd()
offprojects = launchfolder + "/OfficialProjects/"
launcherfiles = offprojects + "/LAUNCHERFILES/"
launchergithuburl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/KOTIKOT_launcher.py"
launcherguigithuburl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/LAUNCHERFILES/KOTIKOTlauncherMain.py"
################### Checking folders #####################
if not os.path.exists(offprojects):
os.mkdir(offprojects)
if not os.path.exists(launcherfiles):
os.mkdir(launcherfiles)
################### Self-updataing launcher #####################
urllib.request.urlretrieve(launchergithuburl, "KOTIKOT_launcher.py")
urllib.request.urlretrieve(launcherguigithuburl, launcherfiles + "KOTIKOTlauncherMain.py")
urllib.request.urlretrieve(launcherguigithuburl, launcherfiles + "KOTIKOTlauncherReminder.py")
################### Launching GUI #####################
Popen('python ' + launcherfiles + "KOTIKOTlauncherReminder.py", shell=True)
import OfficialProjects.LAUNCHERFILES.KOTIKOTlauncherMain as kkui
app = kkui.QtWidgets.QApplication(sys.argv)
KOTIKOTlauncher = kkui.QtWidgets.QMainWindow()
ui = kkui.Ui_KOTIKOTlauncher()
ui.setupUi(KOTIKOTlauncher)
KOTIKOTlauncher.show()
################### Launching programs (func) #####################
def launchAutoShipper():
autoShipperDir = offprojects + "/AutoShipper/"
autoShipperUrl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/AutoShipper/autoshipper.py"
if not os.path.exists(autoShipperDir):
os.mkdir(autoShipperDir)
autoShipper = autoShipperDir + "autoshipper.py"
urllib.request.urlretrieve(autoShipperUrl, autoShipper)
Popen('python ' + autoShipper, shell=True)
exit()
def launchAutoBridger():
autoShipperDir = offprojects + "/AutoShipper/"
autoShipperUrl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/AutoShipper/autoshipper.py"
if not os.path.exists(autoShipperDir):
os.mkdir(autoShipperDir)
autoShipper = autoShipperDir + "autoshipper.py"
urllib.request.urlretrieve(autoShipperUrl, autoShipper)
Popen('python ' + autoShipper, shell=True)
################### Checking buttons #####################
ui.pushButton_1.clicked.connect(launchAutoShipper)
################### Exiting #####################
sys.exit(app.exec_())