From 8bbe30cc2fc4c7320041ef55d8a1b1036256ffdb Mon Sep 17 00:00:00 2001 From: dom <wagnr@icloud.com> Date: Thu, 22 Aug 2019 00:50:17 +0200 Subject: [PATCH] fix(menu): exclude files starting with a . from the menu (e.g. macOS created apple double files) --- preload/menu.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/preload/menu.py b/preload/menu.py index 944621328..390769ef2 100644 --- a/preload/menu.py +++ b/preload/menu.py @@ -62,14 +62,17 @@ def list_apps(): ] ) + + dirlist = [entry for entry in sorted(os.listdir("/apps")) if not entry.startswith(".")] + # list all hatchary style apps (not .elf and not .py) # with or without metadata.json - for appFolder in sorted(os.listdir("/apps")): + for appFolder in dirlist: if not (appFolder.endswith(".py") or appFolder.endswith(".elf")): apps.append(["/apps/%s/__init__.py" % appFolder, read_metadata(appFolder)]) # list simple python scripts - for pyFile in sorted(os.listdir("/apps")): + for pyFile in dirlist: if pyFile.endswith(".py"): apps.append( [ @@ -85,7 +88,7 @@ def list_apps(): ) # list simple elf binaries - for elfFile in sorted(os.listdir("/apps")): + for elfFile in dirlist: if elfFile.endswith(".elf"): apps.append( [ -- GitLab