diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-03-22 12:37:19 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-03-22 12:37:19 (GMT) |
| commit | f8bd1a74613a79cad56b5b60079402d40a87d131 (patch) | |
| tree | a0ac41ef104c8a39375357e2d730d16b9602f86d /wasp/apps/testapp.py | |
| parent | 5a234c16ada5319228fd2231957ca64d2c9141f8 (diff) | |
Rename manager.py and expose its interfaces to all applications
This is a big change that break compatiblity with existing applications
*and* with existing installed versions of main.py.
When upgrading it is import to update main.py:
./tools/wasptool --upload wasp/main.py
Diffstat (limited to 'wasp/apps/testapp.py')
| -rw-r--r-- | wasp/apps/testapp.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/wasp/apps/testapp.py b/wasp/apps/testapp.py index 0ab33a3..fc32ea0 100644 --- a/wasp/apps/testapp.py +++ b/wasp/apps/testapp.py @@ -1,7 +1,5 @@ -import watch -import widgets -import manager import machine +import wasp class TestApp(): """Simple test application. @@ -11,11 +9,11 @@ class TestApp(): self.tests = ('Touch', 'String') self.test = self.tests[0] - def foreground(self, system, effect=None): + def foreground(self, effect=None): """Activate the application.""" self.on_screen = ( -1, -1, -1, -1, -1, -1 ) self.draw(effect) - system.request_event(manager.EVENT_TOUCH | manager.EVENT_SWIPE_UPDOWN) + wasp.system.request_event(wasp.EVENT_TOUCH | wasp.EVENT_SWIPE_UPDOWN) def background(self): """De-activate the application (without losing state).""" @@ -33,7 +31,7 @@ class TestApp(): self.draw() def touch(self, event): - draw = watch.drawable + draw = wasp.watch.drawable if self.test == 'Touch': draw.string('({}, {})'.format(event[1], event[2]), 0, 108, width=240) @@ -55,8 +53,8 @@ class TestApp(): def draw(self, effect=None): """Redraw the display from scratch.""" - watch.display.mute(True) - watch.drawable.fill() - watch.drawable.string('{} test'.format(self.test), + wasp.watch.display.mute(True) + wasp.watch.drawable.fill() + wasp.watch.drawable.string('{} test'.format(self.test), 0, 6, width=240) - watch.display.mute(False) + wasp.watch.display.mute(False) |
