omnipython-apps 0.1.4.dev8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- omnipython_apps-0.1.4.dev8/PKG-INFO +33 -0
- omnipython_apps-0.1.4.dev8/__init__.py +5 -0
- omnipython_apps-0.1.4.dev8/about/__init__.py +257 -0
- omnipython_apps-0.1.4.dev8/about/app.json +1 -0
- omnipython_apps-0.1.4.dev8/about/credits.py +12 -0
- omnipython_apps-0.1.4.dev8/about/facts.py +398 -0
- omnipython_apps-0.1.4.dev8/about/fonts/OFL.txt +93 -0
- omnipython_apps-0.1.4.dev8/about/fonts/latin1_14.bin +0 -0
- omnipython_apps-0.1.4.dev8/about/fonts/latin1_16.bin +0 -0
- omnipython_apps-0.1.4.dev8/about/fonts/latin1_24.bin +0 -0
- omnipython_apps-0.1.4.dev8/about/fonts/latin1_32.bin +0 -0
- omnipython_apps-0.1.4.dev8/about/fonts/latin1_40.bin +0 -0
- omnipython_apps-0.1.4.dev8/backline/__init__.py +58 -0
- omnipython_apps-0.1.4.dev8/backline/app.json +1 -0
- omnipython_apps-0.1.4.dev8/backline/app.py +475 -0
- omnipython_apps-0.1.4.dev8/backline/art.py +717 -0
- omnipython_apps-0.1.4.dev8/backline/ask.py +781 -0
- omnipython_apps-0.1.4.dev8/backline/box.py +502 -0
- omnipython_apps-0.1.4.dev8/backline/cast.py +137 -0
- omnipython_apps-0.1.4.dev8/backline/desk/__init__.py +329 -0
- omnipython_apps-0.1.4.dev8/backline/desk/editor.py +331 -0
- omnipython_apps-0.1.4.dev8/backline/desk/grid.py +154 -0
- omnipython_apps-0.1.4.dev8/backline/desk/look.py +169 -0
- omnipython_apps-0.1.4.dev8/backline/desk/pedals.py +102 -0
- omnipython_apps-0.1.4.dev8/backline/desk/perform.py +157 -0
- omnipython_apps-0.1.4.dev8/backline/desk/prompt.py +210 -0
- omnipython_apps-0.1.4.dev8/backline/desk/strip.py +159 -0
- omnipython_apps-0.1.4.dev8/backline/desk_main.py +226 -0
- omnipython_apps-0.1.4.dev8/backline/engine.py +622 -0
- omnipython_apps-0.1.4.dev8/backline/floor.py +509 -0
- omnipython_apps-0.1.4.dev8/backline/footswitch.py +119 -0
- omnipython_apps-0.1.4.dev8/backline/glyphs.py +82 -0
- omnipython_apps-0.1.4.dev8/backline/kits.py +428 -0
- omnipython_apps-0.1.4.dev8/backline/midipedal.py +362 -0
- omnipython_apps-0.1.4.dev8/backline/page_data.py +413 -0
- omnipython_apps-0.1.4.dev8/backline/parts.py +145 -0
- omnipython_apps-0.1.4.dev8/backline/pedal.py +107 -0
- omnipython_apps-0.1.4.dev8/backline/remote.py +134 -0
- omnipython_apps-0.1.4.dev8/backline/songs/ballad_68.json +1 -0
- omnipython_apps-0.1.4.dev8/backline/songs/bossa.json +1 -0
- omnipython_apps-0.1.4.dev8/backline/songs/country_train.json +1 -0
- omnipython_apps-0.1.4.dev8/backline/songs/funk.json +1 -0
- omnipython_apps-0.1.4.dev8/backline/songs/metal.json +1 -0
- omnipython_apps-0.1.4.dev8/backline/songs/pop.json +1 -0
- omnipython_apps-0.1.4.dev8/backline/songs/rock.json +1 -0
- omnipython_apps-0.1.4.dev8/backline/songs/shuffle.json +1 -0
- omnipython_apps-0.1.4.dev8/battery/__init__.py +101 -0
- omnipython_apps-0.1.4.dev8/battery/app.json +1 -0
- omnipython_apps-0.1.4.dev8/bit_world/act_deck.py +683 -0
- omnipython_apps-0.1.4.dev8/bit_world/act_game.py +762 -0
- omnipython_apps-0.1.4.dev8/bit_world/act_pet.py +1032 -0
- omnipython_apps-0.1.4.dev8/bit_world/app.json +1 -0
- omnipython_apps-0.1.4.dev8/bit_world/bit_output.py +45 -0
- omnipython_apps-0.1.4.dev8/bit_world/bit_palette.py +503 -0
- omnipython_apps-0.1.4.dev8/bit_world/bit_sound.py +431 -0
- omnipython_apps-0.1.4.dev8/bit_world/bit_sprites.py +632 -0
- omnipython_apps-0.1.4.dev8/bit_world/bit_world.py +534 -0
- omnipython_apps-0.1.4.dev8/btreceiver/__init__.py +690 -0
- omnipython_apps-0.1.4.dev8/btreceiver/app.json +1 -0
- omnipython_apps-0.1.4.dev8/btreceiver/chime.py +155 -0
- omnipython_apps-0.1.4.dev8/btreceiver/demo.py +529 -0
- omnipython_apps-0.1.4.dev8/btreceiver/screen.py +633 -0
- omnipython_apps-0.1.4.dev8/camera/__init__.py +316 -0
- omnipython_apps-0.1.4.dev8/camera/app.json +1 -0
- omnipython_apps-0.1.4.dev8/card/__init__.py +113 -0
- omnipython_apps-0.1.4.dev8/card/app.json +1 -0
- omnipython_apps-0.1.4.dev8/cast/__init__.py +631 -0
- omnipython_apps-0.1.4.dev8/cast/app.json +1 -0
- omnipython_apps-0.1.4.dev8/cast/receivers.py +193 -0
- omnipython_apps-0.1.4.dev8/chess/__init__.py +18 -0
- omnipython_apps-0.1.4.dev8/chess/app.json +1 -0
- omnipython_apps-0.1.4.dev8/chess/app.py +922 -0
- omnipython_apps-0.1.4.dev8/chess/art.py +323 -0
- omnipython_apps-0.1.4.dev8/chess/ble.py +411 -0
- omnipython_apps-0.1.4.dev8/chess/engine.py +925 -0
- omnipython_apps-0.1.4.dev8/chess/game.py +327 -0
- omnipython_apps-0.1.4.dev8/chess/net.py +261 -0
- omnipython_apps-0.1.4.dev8/clock/__init__.py +38 -0
- omnipython_apps-0.1.4.dev8/clock/app.json +1 -0
- omnipython_apps-0.1.4.dev8/detect/__init__.py +214 -0
- omnipython_apps-0.1.4.dev8/detect/app.json +1 -0
- omnipython_apps-0.1.4.dev8/fmsynth/__init__.py +41 -0
- omnipython_apps-0.1.4.dev8/fmsynth/algorithms.py +61 -0
- omnipython_apps-0.1.4.dev8/fmsynth/app.json +1 -0
- omnipython_apps-0.1.4.dev8/fmsynth/app.py +355 -0
- omnipython_apps-0.1.4.dev8/fmsynth/editor.py +206 -0
- omnipython_apps-0.1.4.dev8/fmsynth/engine.py +257 -0
- omnipython_apps-0.1.4.dev8/fmsynth/meters.py +262 -0
- omnipython_apps-0.1.4.dev8/fmsynth/midi.py +375 -0
- omnipython_apps-0.1.4.dev8/fmsynth/panel_view.py +1071 -0
- omnipython_apps-0.1.4.dev8/fmsynth/patches/fmsynth-01.syx +0 -0
- omnipython_apps-0.1.4.dev8/fmsynth/settings.py +138 -0
- omnipython_apps-0.1.4.dev8/fmsynth/voice.py +398 -0
- omnipython_apps-0.1.4.dev8/gamepad/__init__.py +685 -0
- omnipython_apps-0.1.4.dev8/gamepad/app.json +1 -0
- omnipython_apps-0.1.4.dev8/gamepad/pad.py +94 -0
- omnipython_apps-0.1.4.dev8/gamepad/watch.py +352 -0
- omnipython_apps-0.1.4.dev8/hidden/__init__.py +72 -0
- omnipython_apps-0.1.4.dev8/hidden/app.json +1 -0
- omnipython_apps-0.1.4.dev8/home/__init__.py +483 -0
- omnipython_apps-0.1.4.dev8/home/app.json +1 -0
- omnipython_apps-0.1.4.dev8/home/main.py +36 -0
- omnipython_apps-0.1.4.dev8/homeassistant/__init__.py +213 -0
- omnipython_apps-0.1.4.dev8/homeassistant/api.py +104 -0
- omnipython_apps-0.1.4.dev8/homeassistant/app.json +1 -0
- omnipython_apps-0.1.4.dev8/huey/__init__.py +287 -0
- omnipython_apps-0.1.4.dev8/huey/acting.py +184 -0
- omnipython_apps-0.1.4.dev8/huey/actor.py +194 -0
- omnipython_apps-0.1.4.dev8/huey/app.json +1 -0
- omnipython_apps-0.1.4.dev8/huey/client.py +125 -0
- omnipython_apps-0.1.4.dev8/huey/servers.py +121 -0
- omnipython_apps-0.1.4.dev8/huey/settings.example.json +8 -0
- omnipython_apps-0.1.4.dev8/huey/settings.py +97 -0
- omnipython_apps-0.1.4.dev8/huey/turn.py +504 -0
- omnipython_apps-0.1.4.dev8/huey/voice.py +217 -0
- omnipython_apps-0.1.4.dev8/info/__init__.py +810 -0
- omnipython_apps-0.1.4.dev8/info/app.json +1 -0
- omnipython_apps-0.1.4.dev8/lora/__init__.py +62 -0
- omnipython_apps-0.1.4.dev8/lora/app.json +1 -0
- omnipython_apps-0.1.4.dev8/manifest.py +71 -0
- omnipython_apps-0.1.4.dev8/medialink_baby_monitor/__init__.py +222 -0
- omnipython_apps-0.1.4.dev8/medialink_baby_monitor/app.json +1 -0
- omnipython_apps-0.1.4.dev8/medialink_doorbell/__init__.py +251 -0
- omnipython_apps-0.1.4.dev8/medialink_doorbell/app.json +1 -0
- omnipython_apps-0.1.4.dev8/medialink_hands_free/__init__.py +217 -0
- omnipython_apps-0.1.4.dev8/medialink_hands_free/app.json +1 -0
- omnipython_apps-0.1.4.dev8/medialink_surveillance_camera/__init__.py +258 -0
- omnipython_apps-0.1.4.dev8/medialink_surveillance_camera/app.json +1 -0
- omnipython_apps-0.1.4.dev8/medialink_video_doorbell/__init__.py +289 -0
- omnipython_apps-0.1.4.dev8/medialink_video_doorbell/app.json +1 -0
- omnipython_apps-0.1.4.dev8/medialink_videophone/__init__.py +273 -0
- omnipython_apps-0.1.4.dev8/medialink_videophone/app.json +1 -0
- omnipython_apps-0.1.4.dev8/medialink_walkie_talkie/__init__.py +228 -0
- omnipython_apps-0.1.4.dev8/medialink_walkie_talkie/app.json +1 -0
- omnipython_apps-0.1.4.dev8/midicontroller/__init__.py +774 -0
- omnipython_apps-0.1.4.dev8/midicontroller/app.json +1 -0
- omnipython_apps-0.1.4.dev8/midicontroller/links.py +421 -0
- omnipython_apps-0.1.4.dev8/midicontroller/surface.py +343 -0
- omnipython_apps-0.1.4.dev8/midiengine/__init__.py +977 -0
- omnipython_apps-0.1.4.dev8/midiengine/app.json +1 -0
- omnipython_apps-0.1.4.dev8/midiengine/banks.py +85 -0
- omnipython_apps-0.1.4.dev8/midiengine/midiin.py +165 -0
- omnipython_apps-0.1.4.dev8/midiengine/player.py +392 -0
- omnipython_apps-0.1.4.dev8/midiengine/umidiparser.py +1413 -0
- omnipython_apps-0.1.4.dev8/mp3/__init__.py +240 -0
- omnipython_apps-0.1.4.dev8/mp3/app.json +1 -0
- omnipython_apps-0.1.4.dev8/omnipython_apps.egg-info/PKG-INFO +33 -0
- omnipython_apps-0.1.4.dev8/omnipython_apps.egg-info/SOURCES.txt +434 -0
- omnipython_apps-0.1.4.dev8/omnipython_apps.egg-info/dependency_links.txt +1 -0
- omnipython_apps-0.1.4.dev8/omnipython_apps.egg-info/requires.txt +11 -0
- omnipython_apps-0.1.4.dev8/omnipython_apps.egg-info/top_level.txt +1 -0
- omnipython_apps-0.1.4.dev8/perch/__init__.py +119 -0
- omnipython_apps-0.1.4.dev8/perch/app.json +1 -0
- omnipython_apps-0.1.4.dev8/perch/huey.py +481 -0
- omnipython_apps-0.1.4.dev8/perch/huey_props.py +386 -0
- omnipython_apps-0.1.4.dev8/perch/huey_shift.py +42 -0
- omnipython_apps-0.1.4.dev8/perch/huey_views.py +296 -0
- omnipython_apps-0.1.4.dev8/perch/scene_bench.py +680 -0
- omnipython_apps-0.1.4.dev8/perch/scene_coast.py +479 -0
- omnipython_apps-0.1.4.dev8/perch/scene_desk.py +492 -0
- omnipython_apps-0.1.4.dev8/perch/stage.py +1274 -0
- omnipython_apps-0.1.4.dev8/perch/vec.py +366 -0
- omnipython_apps-0.1.4.dev8/pyproject.toml +129 -0
- omnipython_apps-0.1.4.dev8/repl/__init__.py +325 -0
- omnipython_apps-0.1.4.dev8/repl/app.json +1 -0
- omnipython_apps-0.1.4.dev8/roku/__init__.py +156 -0
- omnipython_apps-0.1.4.dev8/roku/app.json +1 -0
- omnipython_apps-0.1.4.dev8/rokucam/__init__.py +362 -0
- omnipython_apps-0.1.4.dev8/rokucam/app.json +1 -0
- omnipython_apps-0.1.4.dev8/security/__init__.py +261 -0
- omnipython_apps-0.1.4.dev8/security/app.json +1 -0
- omnipython_apps-0.1.4.dev8/settings/__init__.py +221 -0
- omnipython_apps-0.1.4.dev8/settings/app.json +1 -0
- omnipython_apps-0.1.4.dev8/setup.cfg +4 -0
- omnipython_apps-0.1.4.dev8/shell/__init__.py +33 -0
- omnipython_apps-0.1.4.dev8/shell/app.json +1 -0
- omnipython_apps-0.1.4.dev8/spotify/__init__.py +669 -0
- omnipython_apps-0.1.4.dev8/spotify/app.json +1 -0
- omnipython_apps-0.1.4.dev8/spotify/screen.py +82 -0
- omnipython_apps-0.1.4.dev8/steps/__init__.py +58 -0
- omnipython_apps-0.1.4.dev8/steps/app.json +1 -0
- omnipython_apps-0.1.4.dev8/stompbox/__init__.py +31 -0
- omnipython_apps-0.1.4.dev8/stompbox/app.json +1 -0
- omnipython_apps-0.1.4.dev8/stompbox/app.py +668 -0
- omnipython_apps-0.1.4.dev8/stompbox/boards.json +20 -0
- omnipython_apps-0.1.4.dev8/stompbox/effects.py +241 -0
- omnipython_apps-0.1.4.dev8/stompbox/engine.py +340 -0
- omnipython_apps-0.1.4.dev8/stompbox/footswitch.py +331 -0
- omnipython_apps-0.1.4.dev8/stompbox/inputs.py +449 -0
- omnipython_apps-0.1.4.dev8/stompbox/meter.py +72 -0
- omnipython_apps-0.1.4.dev8/stompbox/outputs.py +135 -0
- omnipython_apps-0.1.4.dev8/stompbox/pedals.txt +45 -0
- omnipython_apps-0.1.4.dev8/stompbox/presets.py +106 -0
- omnipython_apps-0.1.4.dev8/stompbox/styles.py +135 -0
- omnipython_apps-0.1.4.dev8/stompbox/ui.py +817 -0
- omnipython_apps-0.1.4.dev8/stompbox/wavfile.py +73 -0
- omnipython_apps-0.1.4.dev8/synthstation/__init__.py +20 -0
- omnipython_apps-0.1.4.dev8/synthstation/app.json +1 -0
- omnipython_apps-0.1.4.dev8/synthstation/audio.py +397 -0
- omnipython_apps-0.1.4.dev8/synthstation/catalog.py +50 -0
- omnipython_apps-0.1.4.dev8/synthstation/meters.py +136 -0
- omnipython_apps-0.1.4.dev8/synthstation/midi.py +380 -0
- omnipython_apps-0.1.4.dev8/synthstation/pads.py +177 -0
- omnipython_apps-0.1.4.dev8/synthstation/parts.py +128 -0
- omnipython_apps-0.1.4.dev8/synthstation/station.py +1069 -0
- omnipython_apps-0.1.4.dev8/system/__init__.py +11 -0
- omnipython_apps-0.1.4.dev8/system/app.json +1 -0
- omnipython_apps-0.1.4.dev8/touchcal/__init__.py +324 -0
- omnipython_apps-0.1.4.dev8/touchcal/app.json +1 -0
- omnipython_apps-0.1.4.dev8/touchcal/fit.py +262 -0
- omnipython_apps-0.1.4.dev8/wake/__init__.py +268 -0
- omnipython_apps-0.1.4.dev8/wake/app.json +1 -0
- omnipython_apps-0.1.4.dev8/wake/feed.py +155 -0
- omnipython_apps-0.1.4.dev8/watch/__init__.py +355 -0
- omnipython_apps-0.1.4.dev8/watch/app.json +1 -0
- omnipython_apps-0.1.4.dev8/watch/faces.py +35 -0
- omnipython_apps-0.1.4.dev8/watch/wheel.py +157 -0
- omnipython_apps-0.1.4.dev8/weather/__init__.py +278 -0
- omnipython_apps-0.1.4.dev8/weather/app.json +1 -0
- omnipython_apps-0.1.4.dev8/weather/icons.py +172 -0
- omnipython_apps-0.1.4.dev8/weather/sizing.py +71 -0
- omnipython_apps-0.1.4.dev8/weather/zippad.py +172 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: omnipython-apps
|
|
3
|
+
Version: 0.1.4.dev8
|
|
4
|
+
Summary: Every app for Home, with everything the apps need
|
|
5
|
+
Author: Brad Barnett
|
|
6
|
+
License: MIT
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: numpy
|
|
9
|
+
Requires-Dist: omnipython-audioeffects
|
|
10
|
+
Requires-Dist: omnipython-audioinstruments
|
|
11
|
+
Requires-Dist: omnipython-desktop>=0.8.2.dev11
|
|
12
|
+
Requires-Dist: omnipython-lvgl
|
|
13
|
+
Requires-Dist: omnipython-palettes
|
|
14
|
+
Requires-Dist: omnipython-pygraphics
|
|
15
|
+
Requires-Dist: omnipython>=0.8.1.dev10
|
|
16
|
+
Requires-Dist: requests
|
|
17
|
+
Requires-Dist: scipy
|
|
18
|
+
Requires-Dist: omnipython-applibs==0.1.4.dev8
|
|
19
|
+
|
|
20
|
+
# omnipython-apps
|
|
21
|
+
|
|
22
|
+
Every app for Home from [PyDevices/apps](https://github.com/PyDevices/apps),
|
|
23
|
+
installed as the package `apps`, with the libraries they share
|
|
24
|
+
(`omnipython-applibs` of the same version) and everything else they need on a
|
|
25
|
+
computer:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install omnipython-apps
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
On a board, `omip.install("apps")` installs the same apps from the OmniPython
|
|
32
|
+
index. [The install page](https://github.com/PyDevices/apps/blob/main/docs/get-started/install.md)
|
|
33
|
+
says how to start Home once they're in.
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Brad Barnett
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
"""About: what this board is and the software on it.
|
|
5
|
+
|
|
6
|
+
One scrolling page of cards: the board's name and chip, the firmware and
|
|
7
|
+
OmniPython versions, each installed package's version, memory and storage,
|
|
8
|
+
the network and its address, then the open-source licences and credits,
|
|
9
|
+
the firmware's own among them.
|
|
10
|
+
Info is the page for how the board is doing now; this is the page for what
|
|
11
|
+
it is. A line is left out when this platform can't say it.
|
|
12
|
+
|
|
13
|
+
`rows` returns the same facts as lists, so the REPL can print them::
|
|
14
|
+
|
|
15
|
+
>>> import apps.about
|
|
16
|
+
>>> apps.about.rows()
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
import lvgl as lv
|
|
20
|
+
|
|
21
|
+
from appkit import assets, shell
|
|
22
|
+
from touchkit import net, ui
|
|
23
|
+
|
|
24
|
+
from ..info import stats
|
|
25
|
+
from . import facts
|
|
26
|
+
from .credits import SECTIONS
|
|
27
|
+
|
|
28
|
+
#: The Montserrat sizes LVGL builds, and those of the fonts in fonts/ (tools/make_fonts.py).
|
|
29
|
+
_SIZES = (14, 16, 24, 32, 40)
|
|
30
|
+
#: Milliseconds between two steps of filling in the page, so a tap or a drag is heard between them.
|
|
31
|
+
STEP_MS = 10
|
|
32
|
+
|
|
33
|
+
_HERE = __file__.replace("\\", "/").rsplit("/", 1)[0]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def rows():
|
|
37
|
+
"""The page as ``[(card title, [(name, value), ...]), ...]``, without opening it.
|
|
38
|
+
|
|
39
|
+
The licences card is not here: it is text, not rows (`facts.installed_licences`,
|
|
40
|
+
`facts.firmware_notices`, `facts.notices` and `credits.SECTIONS`).
|
|
41
|
+
"""
|
|
42
|
+
s = stats()
|
|
43
|
+
cards = [
|
|
44
|
+
("Board", facts.board_rows(s, net.hostname())),
|
|
45
|
+
("Firmware", facts.firmware_rows(s)),
|
|
46
|
+
("Packages", facts.packages()),
|
|
47
|
+
("Memory and storage", facts.memory_rows()),
|
|
48
|
+
("Network", facts.network_rows(s.get("ip"))),
|
|
49
|
+
]
|
|
50
|
+
return [(title, r) for title, r in cards if r]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _font(short, share):
|
|
54
|
+
"""The largest Montserrat this firmware has at or below *short* / *share*, or its smallest,
|
|
55
|
+
with the accented letters of Latin-1 from fonts/ in front of it.
|
|
56
|
+
|
|
57
|
+
LVGL's own Montserrat stops at ASCII. The file's font has only the letters
|
|
58
|
+
past it and hands the rest to the built-in one, so a name like Zoltán
|
|
59
|
+
Vörös draws. The caller frees it with ``lv.binfont_destroy`` once
|
|
60
|
+
nothing draws with it.
|
|
61
|
+
"""
|
|
62
|
+
limit = short // share
|
|
63
|
+
best = None
|
|
64
|
+
for size in _SIZES:
|
|
65
|
+
if getattr(lv, "font_montserrat_%d" % size, None) is not None and (best is None or size <= limit):
|
|
66
|
+
best = size
|
|
67
|
+
if best is None: # a firmware with none of these sizes: ASCII only
|
|
68
|
+
return lv.font_get_default()
|
|
69
|
+
data = assets.read("%s/fonts/latin1_%d.bin" % (_HERE, best), binary=True)
|
|
70
|
+
font = lv.binfont_create_from_buffer(data, len(data))
|
|
71
|
+
if font is None:
|
|
72
|
+
raise OSError("About couldn't load fonts/latin1_%d.bin" % best)
|
|
73
|
+
font.fallback = getattr(lv, "font_montserrat_%d" % best)
|
|
74
|
+
return font
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _card(parent, pad):
|
|
78
|
+
c = lv.obj(parent)
|
|
79
|
+
c.set_width(lv.pct(100))
|
|
80
|
+
c.set_height(lv.SIZE_CONTENT)
|
|
81
|
+
c.set_style_bg_color(ui.PANEL, 0)
|
|
82
|
+
c.set_style_text_color(ui.WHITE, 0)
|
|
83
|
+
c.set_style_border_width(0, 0)
|
|
84
|
+
c.set_style_radius(pad * 2, 0)
|
|
85
|
+
c.set_style_pad_all(pad, 0)
|
|
86
|
+
c.set_style_pad_gap(pad // 2, 0)
|
|
87
|
+
c.set_flex_flow(lv.FLEX_FLOW.COLUMN)
|
|
88
|
+
c.remove_flag(lv.obj.FLAG.SCROLLABLE)
|
|
89
|
+
c.add_flag(lv.obj.FLAG.EVENT_BUBBLE) # a drag that starts on a card scrolls the page
|
|
90
|
+
return c
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _heading(card, text):
|
|
94
|
+
return ui.label(card, text, None, ui.ACCENT)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def _row(card, key, value, pad):
|
|
98
|
+
row = ui.plain(lv.obj(card))
|
|
99
|
+
row.set_width(lv.pct(100))
|
|
100
|
+
row.set_height(lv.SIZE_CONTENT)
|
|
101
|
+
row.set_flex_flow(lv.FLEX_FLOW.ROW)
|
|
102
|
+
row.set_style_pad_column(pad, 0) # a key never runs into its value
|
|
103
|
+
row.add_flag(lv.obj.FLAG.EVENT_BUBBLE)
|
|
104
|
+
k = ui.label(row, key, None, ui.MUTED)
|
|
105
|
+
k.set_width(lv.SIZE_CONTENT)
|
|
106
|
+
v = lv.label(row)
|
|
107
|
+
v.set_text(value)
|
|
108
|
+
v.set_flex_grow(1)
|
|
109
|
+
v.set_long_mode(lv.label.LONG_MODE.WRAP)
|
|
110
|
+
v.set_style_text_align(lv.TEXT_ALIGN.RIGHT, 0)
|
|
111
|
+
return k, v
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def _text(card, text, color):
|
|
115
|
+
t = ui.label(card, facts.reflow(text), None, color)
|
|
116
|
+
t.set_width(lv.pct(100))
|
|
117
|
+
t.set_long_mode(lv.label.LONG_MODE.WRAP)
|
|
118
|
+
return t
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def _cards(page, pad, cards):
|
|
122
|
+
for title, items in cards:
|
|
123
|
+
if items:
|
|
124
|
+
card = _card(page, pad)
|
|
125
|
+
_heading(card, title)
|
|
126
|
+
_rows(card, items, pad)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def _rows(card, items, pad):
|
|
130
|
+
"""Add *items* to *card*, which stays hidden while it has none."""
|
|
131
|
+
for key, value in items:
|
|
132
|
+
_row(card, key, value, pad)
|
|
133
|
+
if card.get_child_count() > 1: # more than its heading
|
|
134
|
+
card.remove_flag(lv.obj.FLAG.HIDDEN)
|
|
135
|
+
else:
|
|
136
|
+
card.add_flag(lv.obj.FLAG.HIDDEN)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class _Packages:
|
|
140
|
+
"""The Packages card, kept sorted as versions found later come in.
|
|
141
|
+
|
|
142
|
+
A board can have seventy packages, so the card is two labels, the names
|
|
143
|
+
and the versions, one line each, rather than a row of three objects for
|
|
144
|
+
each: on an ESP32-S3 the rows took most of a second to make.
|
|
145
|
+
"""
|
|
146
|
+
|
|
147
|
+
def __init__(self, page, pad, known):
|
|
148
|
+
self.card = _card(page, pad)
|
|
149
|
+
_heading(self.card, "Packages")
|
|
150
|
+
self.names, self.versions = _row(self.card, "", "", pad)
|
|
151
|
+
for label in (self.names, self.versions):
|
|
152
|
+
label.set_style_text_line_space(pad // 2, 0) # spaced as the other cards' rows
|
|
153
|
+
self.found = dict(known)
|
|
154
|
+
self._show()
|
|
155
|
+
|
|
156
|
+
def add(self, name, version):
|
|
157
|
+
self.found[name] = version
|
|
158
|
+
self._show()
|
|
159
|
+
|
|
160
|
+
def _show(self):
|
|
161
|
+
found = sorted(self.found.items(), key=lambda r: r[0].lower())
|
|
162
|
+
self.names.set_text("\n".join(n for n, _ in found))
|
|
163
|
+
self.versions.set_text("\n".join(v for _, v in found))
|
|
164
|
+
if found:
|
|
165
|
+
self.card.remove_flag(lv.obj.FLAG.HIDDEN)
|
|
166
|
+
else:
|
|
167
|
+
self.card.add_flag(lv.obj.FLAG.HIDDEN)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def _steps(memory, packages, licences, known, pad):
|
|
171
|
+
"""What fills in the page after it is drawn, one short step each.
|
|
172
|
+
|
|
173
|
+
Free storage, the firmware's notices, then each folder on the board, which
|
|
174
|
+
may add a package's version and its licence, then this repository's credits.
|
|
175
|
+
"""
|
|
176
|
+
yield lambda: _rows(memory, facts.storage_rows(), pad)
|
|
177
|
+
for title, text in facts.firmware_notices():
|
|
178
|
+
yield lambda t=title, x=text: _notice(licences, t, x)
|
|
179
|
+
for root, name, is_lib in facts.folders():
|
|
180
|
+
yield lambda r=root, n=name, lib=is_lib: _folder(packages, licences, known, r, n, lib)
|
|
181
|
+
for title, text in SECTIONS:
|
|
182
|
+
yield lambda t=title, x=text: _notice(licences, t, x)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def _notice(card, title, text):
|
|
186
|
+
_text(card, title, ui.WHITE)
|
|
187
|
+
_text(card, text, ui.MUTED)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _folder(packages, licences, known, root, name, is_lib):
|
|
191
|
+
version, notice = facts.folder_facts(root, name, is_lib, known)
|
|
192
|
+
if version:
|
|
193
|
+
known[name] = version
|
|
194
|
+
packages.add(name, version)
|
|
195
|
+
if notice:
|
|
196
|
+
_notice(licences, name, notice)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def main(scope):
|
|
200
|
+
W, H = scope.size
|
|
201
|
+
short = min(W, H)
|
|
202
|
+
root = scope.root
|
|
203
|
+
root.set_style_bg_color(ui.BG, 0)
|
|
204
|
+
root.set_style_bg_opa(lv.OPA.COVER, 0)
|
|
205
|
+
pad = max(4, short // 40)
|
|
206
|
+
# A round screen keeps to the square inside its circle.
|
|
207
|
+
side = W * 3 // 20 if shell.is_round() else pad
|
|
208
|
+
|
|
209
|
+
page = ui.plain(lv.obj(root))
|
|
210
|
+
page.set_size(W, H)
|
|
211
|
+
font = _font(short, 20)
|
|
212
|
+
page.set_style_text_font(font, 0)
|
|
213
|
+
page.set_style_pad_hor(side, 0)
|
|
214
|
+
page.set_style_pad_ver(pad, 0)
|
|
215
|
+
page.set_style_pad_gap(pad, 0)
|
|
216
|
+
page.set_flex_flow(lv.FLEX_FLOW.COLUMN)
|
|
217
|
+
page.add_flag(lv.obj.FLAG.SCROLLABLE)
|
|
218
|
+
page.set_scroll_dir(lv.DIR.VER)
|
|
219
|
+
if font is not lv.font_get_default():
|
|
220
|
+
|
|
221
|
+
@scope.on_close
|
|
222
|
+
def free_font():
|
|
223
|
+
page.delete() # nothing may draw with the font once it's gone
|
|
224
|
+
lv.binfont_destroy(font)
|
|
225
|
+
|
|
226
|
+
# What the board can say at once goes on the first screen. Looking in each
|
|
227
|
+
# folder on the board takes a while (importing a package to read its
|
|
228
|
+
# version, opening its licence), so that comes after, a folder at a time.
|
|
229
|
+
s = stats()
|
|
230
|
+
on_board = facts.on_board()
|
|
231
|
+
known = facts.known_packages() if on_board else dict(facts.packages())
|
|
232
|
+
_cards(page, pad, (("Board", facts.board_rows(s, net.hostname())), ("Firmware", facts.firmware_rows(s))))
|
|
233
|
+
packages = _Packages(page, pad, known)
|
|
234
|
+
memory = _card(page, pad)
|
|
235
|
+
_heading(memory, "Memory and storage")
|
|
236
|
+
_rows(memory, facts.memory_rows(storage=False), pad)
|
|
237
|
+
_cards(page, pad, (("Network", facts.network_rows(s.get("ip"))),))
|
|
238
|
+
|
|
239
|
+
# The licences: each installed package's own, what the firmware was built
|
|
240
|
+
# from, each package folder's notice, then what this repository's apps carry.
|
|
241
|
+
licences = _card(page, pad)
|
|
242
|
+
_heading(licences, "Licences and credits")
|
|
243
|
+
for key, value in facts.installed_licences():
|
|
244
|
+
_row(licences, key, value, pad)
|
|
245
|
+
|
|
246
|
+
# Draw this much now, so the steps add to a page already showing rather
|
|
247
|
+
# than hold back the first screen.
|
|
248
|
+
lv.refr_now(None)
|
|
249
|
+
steps = _steps(memory, packages, licences, known, pad)
|
|
250
|
+
|
|
251
|
+
def step(timer):
|
|
252
|
+
for fill in steps:
|
|
253
|
+
fill()
|
|
254
|
+
scope.after(STEP_MS, step)
|
|
255
|
+
return
|
|
256
|
+
|
|
257
|
+
scope.after(STEP_MS, step)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name": "about", "title": "About", "category": "System", "icon": "badge", "color": "#5A3E6B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Brad Barnett
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
"""The licence and credits About shows. Generated by tools/about_credits.py; edit the sources, not this."""
|
|
5
|
+
|
|
6
|
+
SECTIONS = (
|
|
7
|
+
("PyDevices apps", "MIT License\n\nCopyright (c) 2026 Brad Barnett\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."),
|
|
8
|
+
("About", "About draws accented letters with fonts made from another project.\n\nFonts (apps/about/fonts)\n Montserrat Medium, copyright 2011 The Montserrat Project Authors\n (https://github.com/JulietaUla/Montserrat), under the SIL Open Font\n License, Version 1.1 (apps/about/fonts/OFL.txt). The .bin files are\n bitmap fonts of the Latin-1 letters past ASCII, made with lv_font_conv\n by tools/make_fonts.py from the TTF LVGL keeps in its repository."),
|
|
9
|
+
("Chess", "engine.py is a port to Python of p4wn's engine (src/engine.js), by Douglas\nBagnall and the p4wn contributors: https://github.com/douglasbagnall/p4wn,\nat commit fcdda9f5d7ae34bbbacc4caacdc78507b6a20394.\n\np4wn is in the public domain. Its README dedicates every contribution to it\nto the public domain (CC0), and engine.js's header, kept at the top of\nengine.py, reads:\n\n /* p4wn, AKA 5k chess - by Douglas Bagnall <douglas@paradise.net.nz>\n *\n * This code is in the public domain, or as close to it as various\n * laws allow. No warranty; no restrictions.\n *\n * lives at http://p4wn.sf.net/\n */\n\nThe port keeps p4wn's board, move scoring and search, and adds a deadline,\ndeepening one ply at a time, noise for the low levels and perft counting.\nIt is released under this repository's MIT licence.\n\nThe pieces, boards and every other picture are original, drawn for this app\nas SVG in art.py."),
|
|
10
|
+
("Eye Camera", "Camera uses artwork and fonts from other projects.\n\nPictures (apps/eyecam/images)\n The 21 pictures are Espressif's, from the ESP32-P4-EYE factory demo\n (https://github.com/espressif/esp-dev-kits, examples/esp32-p4-eye/\n examples/factory_demo/main/ui/images, commit 5c06bf1). The demo's code is\n \"Apache License 2.0\" under that repository's LICENSE-APACHE, and these\n files are SquareLine Studio exports in that code. Copyright Espressif\n Systems (Shanghai) CO LTD. Changed here: each was converted from an LVGL 8\n C array to an LVGL 9 .bin file (RGB565 with an alpha plane); the pixels\n are the same. The licence text is in LICENSE-APACHE.\n\nFonts (apps/eyecam/fonts)\n KoHo Bold and SemiBold, copyright 2018 The KoHo Project Authors\n (https://github.com/cadsondemak/Koho), under the SIL Open Font License,\n Version 1.1 (apps/eyecam/fonts/OFL.txt). The .bin files are bitmap fonts\n made from the TTFs in tools/fonts with lv_font_conv.\n\nThe page layout, texts and behaviour follow the same factory demo."),
|
|
11
|
+
("FM Synth", "Code adapted from other parts of this repository (github.com/PyDevices/apps),\nall MIT:\n\n - midi.py: the `Inputs` class, with its Bluetooth MIDI input (`set_ble`\n and `ble_available`), is adapted from Synth Station's\n apps/synthstation/midi.py.\n - app.py: `App.set_ble`, which turns Bluetooth MIDI on and remembers the\n choice, is adapted from Synth Station's apps/synthstation/station.py.\n - meters.py: the level, load and underrun readings and the meter's fall\n are adapted from Synth Station's apps/synthstation/audio.py and\n apps/synthstation/meters.py.\n - algorithms.py: the table of 32 algorithms is copied from controlkit's\n examples/routing_algorithms.py.\n\nThe bank in patches/ is original, generated by tools/make_bank.py. It holds\nno factory voices."),
|
|
12
|
+
)
|