Sometimes remove non existing apps automatically
This commit is contained in:
parent
78fed2ce31
commit
683002b831
8
main.py
8
main.py
@ -2,6 +2,7 @@
|
|||||||
import config
|
import config
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
|
import os.path
|
||||||
import serial
|
import serial
|
||||||
import threading
|
import threading
|
||||||
import json
|
import json
|
||||||
@ -325,6 +326,13 @@ for app in config.Apps:
|
|||||||
if "guiname" not in app.keys():
|
if "guiname" not in app.keys():
|
||||||
app["guiname"] = app["name"]
|
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 = AppRunner()
|
||||||
runner.start()
|
runner.start()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user