summaryrefslogtreecommitdiff
path: root/wasp/apps
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-05-14 21:29:35 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-05-14 21:29:35 (GMT)
commitb8efcd30537f04269738e6969376129f4ed88315 (patch)
treecf0f4f2d12603ca85bc5f0b664bcd4883b85f436 /wasp/apps
parentf07fb6d22a7124f945a29c2895cec87a69e08b37 (diff)
wasp: Even more docstrings
Diffstat (limited to 'wasp/apps')
-rw-r--r--wasp/apps/clock.py8
-rw-r--r--wasp/apps/flashlight.py11
-rw-r--r--wasp/apps/launcher.py4
-rw-r--r--wasp/apps/pager.py21
-rw-r--r--wasp/apps/testapp.py4
5 files changed, 33 insertions, 15 deletions
diff --git a/wasp/apps/clock.py b/wasp/apps/clock.py
index 4236d9a..f09f2d4 100644
--- a/wasp/apps/clock.py
+++ b/wasp/apps/clock.py
@@ -1,6 +1,12 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
# Copyright (C) 2020 Daniel Thompson
+"""Digital clock
+~~~~~~~~~~~~~~~~
+
+Shows a time (as HH:MM) together with a battery meter and the date.
+"""
+
import wasp
import icons
@@ -23,8 +29,6 @@ MONTH = 'JanFebMarAprMayJunJulAugSepOctNovDec'
class ClockApp():
"""Simple digital clock application.
-
- Shows a time (as HH:MM) together with a battery meter and the date.
"""
NAME = 'Clock'
ICON = icons.clock
diff --git a/wasp/apps/flashlight.py b/wasp/apps/flashlight.py
index c4702a0..5ca9734 100644
--- a/wasp/apps/flashlight.py
+++ b/wasp/apps/flashlight.py
@@ -1,15 +1,18 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
# Copyright (C) 2020 Daniel Thompson
+"""Flashlight
+~~~~~~~~~~~~~
+
+Shows a pure white screen with the backlight set to maximum.
+"""
+
import wasp
import icons
class FlashlightApp(object):
- """Trivial flashlight application.
-
- Shows a pure white screen with the backlight set to maximum.
- """
+ """Trivial flashlight application."""
NAME = 'Torch'
ICON = icons.torch
diff --git a/wasp/apps/launcher.py b/wasp/apps/launcher.py
index 305cc2e..6a8bab7 100644
--- a/wasp/apps/launcher.py
+++ b/wasp/apps/launcher.py
@@ -1,6 +1,10 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
# Copyright (C) 2020 Daniel Thompson
+"""Application launcher
+~~~~~~~~~~~~~~~~~~~~~~~
+"""
+
import wasp
import icons
diff --git a/wasp/apps/pager.py b/wasp/apps/pager.py
index 7da8f5a..18322d2 100644
--- a/wasp/apps/pager.py
+++ b/wasp/apps/pager.py
@@ -1,20 +1,22 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
# Copyright (C) 2020 Daniel Thompson
+"""Pager applications
+~~~~~~~~~~~~~~~~~~~~~
+
+The pager is used to present text based information to the user. It is
+primarily intended for notifications but is also used to provide debugging
+information when applications crash.
+"""
+
import wasp
import icons
import io
import sys
-
class PagerApp():
- """Show long text in a pager.
-
- This is used to present text based information to the user. It is primarily
- intended for notifications but is also used to provide debugging
- information when applications crash.
- """
+ """Show a long text message in a pager."""
NAME = 'Pager'
ICON = icons.app
@@ -31,10 +33,12 @@ class PagerApp():
self._draw()
def background(self):
+ """De-activate the application."""
del self._chunks
del self._numpages
def swipe(self, event):
+ """Swipe to page up/down."""
mute = wasp.watch.display.mute
if event[0] == wasp.EventType.UP:
@@ -114,6 +118,5 @@ class CrashApp():
wasp.watch.display.invert(True)
def swipe(self, event):
- """Show the exception message in a pager.
- """
+ """Show the exception message in a pager."""
wasp.system.switch(PagerApp(self._msg))
diff --git a/wasp/apps/testapp.py b/wasp/apps/testapp.py
index 4b64d31..6681aa5 100644
--- a/wasp/apps/testapp.py
+++ b/wasp/apps/testapp.py
@@ -1,6 +1,10 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
# Copyright (C) 2020 Daniel Thompson
+"""Self Tests
+~~~~~~~~~~~~~
+"""
+
import machine
import wasp
import icons