Skip to content
Snippets Groups Projects
Commit d33d880b authored by fleur's avatar fleur Committed by rahix
Browse files

fix(menu): Order entries by display name


Fix menu entries being ordered by directory name instead of display
name.

Co-authored-by: default avatarRahix <rahix@rahix.de>
parent 3010d8eb
No related branches found
No related tags found
No related merge requests found
......@@ -17,13 +17,17 @@ import utime
App = collections.namedtuple("App", ["name", "path"])
def enumerate_apps():
"""List all installed apps."""
def enumerate_entries():
for f in os.listdir("/"):
if f == "main.py":
yield App("Home", f)
for app in sorted(os.listdir("/apps")):
yield from sorted(enumerate_apps(), key=lambda b: b.name.lower())
def enumerate_apps():
"""List all installed apps."""
for app in os.listdir("/apps"):
if app.startswith("."):
continue
......@@ -88,7 +92,7 @@ def no_apps_message():
if __name__ == "__main__":
try:
apps = list(enumerate_apps())
apps = list(enumerate_entries())
except OSError:
apps = []
......
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