Skip to content
Snippets Groups Projects
Commit f55df1d2 authored by fleur's avatar fleur
Browse files

untested home problem solution

parent 5a2f65ba
No related branches found
No related tags found
No related merge requests found
...@@ -17,12 +17,13 @@ import utime ...@@ -17,12 +17,13 @@ import utime
App = collections.namedtuple("App", ["name", "path"]) App = collections.namedtuple("App", ["name", "path"])
def enumerate_apps(): def get_home_app():
"""List all installed apps.""" """List all installed apps."""
for f in os.listdir("/"): for f in os.listdir("/"):
if f == "main.py": if f == "main.py":
yield App("Home", f) yield App("Home", f)
def enumerate_apps():
for app in sorted(os.listdir("/apps")): for app in sorted(os.listdir("/apps")):
if app.startswith("."): if app.startswith("."):
continue continue
...@@ -88,7 +89,9 @@ def no_apps_message(): ...@@ -88,7 +89,9 @@ def no_apps_message():
if __name__ == "__main__": if __name__ == "__main__":
try: try:
apps = sorted(list(enumerate_apps()), key=lambda b: b.name.lower()) apps = list(get_home_app())
apps += sorted(list(enumerate_apps()), key=lambda b: b.name.lower())
except OSError: except OSError:
apps = [] apps = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment