mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-21 17:22:18 +01:00
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,free-days-interop) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / free-days-interop (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Todo: 364208fc
32 lines
1023 B
Python
32 lines
1023 B
Python
"""The corner strip's text-free progress row: one pip per morning-session leg.
|
|
|
|
Split out of ``_session_strip.py`` (250-line cap). The strip shows no words
|
|
since 2026-11-10; ``next_step`` in ``morning_session.json`` is still the leg's
|
|
label (a data contract), so the pip row finds its place by looking that label
|
|
up in ``LEGS``.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from wake_alarm._session_legs import LEGS
|
|
|
|
DONE = "●"
|
|
NEXT = "◉"
|
|
LATER = "○"
|
|
|
|
|
|
def pips(step: object) -> str:
|
|
"""Progress pips for ``step`` among the ``LEGS`` labels.
|
|
|
|
One plain geometric character per leg (Tk renders no colour emoji):
|
|
filled for legs already passed, a bullseye for the next step, hollow
|
|
for later ones. ``""`` when ``step`` is not a known label.
|
|
"""
|
|
labels = [label for _, label in LEGS]
|
|
if not isinstance(step, str) or step not in labels:
|
|
return ""
|
|
idx = labels.index(step)
|
|
return " ".join(
|
|
DONE if i < idx else (NEXT if i == idx else LATER) for i in range(len(labels))
|
|
)
|