Sometimes remove non existing apps automatically

This commit is contained in:
Andreas Völker 2018-12-30 16:16:35 +01:00
parent 78fed2ce31
commit 683002b831

View File

@ -2,6 +2,7 @@
import config
import subprocess
import os
import os.path
import serial
import threading
import json
@ -325,6 +326,13 @@ for app in config.Apps:
if "guiname" not in app.keys():
app["guiname"] = app["name"]
#remove unavalible apps
for app in config.Apps:
cmd = app["cmd"]
if type(cmd) == str and not os.path.isfile(cmd):
config.Apps.remove(app)
logging.warning("Removed app "+app["name"])
runner = AppRunner()
runner.start()