summaryrefslogtreecommitdiff
path: root/wasp
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2021-09-10 18:53:28 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2021-09-10 20:17:57 (GMT)
commitba8546dd605799c189ccce778b0c468cb129054d (patch)
treeedbb8dcc118c156f4e5f0b88f3a9032897159a3b /wasp
parent2a3ffad07d62fcca7fa8dd3fe387f4377b44d3e4 (diff)
apps: software: Add support for user-defined applications
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp')
-rw-r--r--wasp/apps/software.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/wasp/apps/software.py b/wasp/apps/software.py
index 91bde38..c51036b 100644
--- a/wasp/apps/software.py
+++ b/wasp/apps/software.py
@@ -16,6 +16,7 @@ whilst still allowing users to activate so many awesome applications!
import wasp
import icons
+import os
class SoftwareApp():
@@ -50,6 +51,20 @@ class SoftwareApp():
db.append(('timer', factory('Timer')))
db.append(('weather', factory('Weather')))
+ # Handle user-loaded applications
+ try:
+ for app in os.listdir('apps'):
+ name = None
+ if app.endswith('.py'):
+ name = app[:-3]
+ if app.endswith('.mpy'):
+ name = app[:-4]
+ if name:
+ db.append((name, factory(name)))
+ except OSError:
+ # apps does not exist...
+ pass
+
# Get the initial state for the checkboxes
for _, checkbox in db:
label = checkbox.label.replace(' ', '')