Skip to content
Snippets Groups Projects
Commit 53419ff7 authored by rahix's avatar rahix
Browse files

fix(menu.py): Display apps without metadata.json


If an app directory is missing metadata.json or if metadata.json is
invalid/cannot be parsed correctly, don't just print an error, also add
a menu entry based on what we'd hope to be correct information.  This is
obviously best effort only and there is no guarantee that it will work.

Signed-off-by: default avatarRahix <rahix@rahix.de>
parent ead70852
No related branches found
No related tags found
No related merge requests found
......@@ -55,8 +55,15 @@ def enumerate_apps(apps=None):
info["name"], "/apps/{}/{}".format(app, info.get("bin", "__init__.py"))
)
except Exception as e:
print("Could not load /apps/{}/metadata.json!".format(app))
print("'{}': metadata.json is invalid ... hoping for the best.".format(app))
sys.print_exception(e)
pyfile = "/apps/{}/__init__.py".format(app)
try:
open(pyfile).close()
yield App(app, pyfile)
except OSError:
print(pyfile, "does not even exist :(")
pass
def usb_mode(disp):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment