Ignore exceptions
This commit is contained in:
@@ -63,33 +63,34 @@ def download_app(app):
|
|||||||
|
|
||||||
|
|
||||||
def launchApp():
|
def launchApp():
|
||||||
with open("OfficialProjects/LAUNCHERFILES/apps.json") as appsfile:
|
try:
|
||||||
apps = json.load(appsfile)
|
with open("OfficialProjects/LAUNCHERFILES/apps.json") as appsfile:
|
||||||
name = KOTIKOTlauncher.sender().text()
|
apps = json.load(appsfile)
|
||||||
app = apps[name]
|
name = KOTIKOTlauncher.sender().text()
|
||||||
directory = offprojects + app['dir']
|
app = apps[name]
|
||||||
|
directory = offprojects + app['dir']
|
||||||
|
|
||||||
if not os.path.exists(directory):
|
if not os.path.exists(directory):
|
||||||
os.mkdir(directory)
|
os.mkdir(directory)
|
||||||
download_app(app)
|
|
||||||
|
|
||||||
else:
|
|
||||||
with open(directory + "/v") as v_file:
|
|
||||||
v = int(v_file.read())
|
|
||||||
if v < int(requests.get('/'.join(app['urls'][0].split('/')[:-1]) + '/v').text):
|
|
||||||
print('Current app version is ' + str(v) + ' and new version is '
|
|
||||||
+ requests.get('/'.join(app['urls'][0].split('/')[:-1]) + '/v').text)
|
|
||||||
print('Updating...')
|
|
||||||
download_app(app)
|
download_app(app)
|
||||||
urllib.request.urlretrieve('/'.join(app['urls'][0].split('/')[:-1]) + '/v',
|
|
||||||
offprojects + app['dir'] + "/v")
|
|
||||||
|
|
||||||
displayName = name.replace('\n', '')
|
else:
|
||||||
print(f"---------------- {displayName} ----------------")
|
with open(directory + "/v") as v_file:
|
||||||
subprocess.Popen(str(sys.executable + " " if app['runtime'] == "python" else "") + app['run'], cwd=directory,
|
v = int(v_file.read())
|
||||||
shell=True, close_fds=True)
|
if v < int(requests.get('/'.join(app['urls'][0].split('/')[:-1]) + '/v').text):
|
||||||
if not app['window']:
|
print('Current app version is ' + str(v) + ' and new version is '
|
||||||
KOTIKOTreminder.show()
|
+ requests.get('/'.join(app['urls'][0].split('/')[:-1]) + '/v').text)
|
||||||
|
print('Updating...')
|
||||||
|
download_app(app)
|
||||||
|
urllib.request.urlretrieve('/'.join(app['urls'][0].split('/')[:-1]) + '/v',
|
||||||
|
offprojects + app['dir'] + "/v")
|
||||||
|
|
||||||
|
displayName = name.replace('\n', '')
|
||||||
|
print(f"---------------- {displayName} ----------------")
|
||||||
|
subprocess.Popen(str(sys.executable + " " if app['runtime'] == "python" else "") + app['run'], cwd=directory,
|
||||||
|
shell=True, close_fds=True)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
# ---------------- Checking buttons ----------------
|
# ---------------- Checking buttons ----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user