mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-11 15:33:58 +01:00
Fix lint in text-free check and glyph tests
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 }}) (flutter, flutter-analyze, ) (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,flutter-analyze) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / lock-popup-safety (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (0) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (1) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (2) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (3) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (4) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (5) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (6) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (7) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (8) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (9) (push) Waiting to run
Tests / flutter-coverage (push) Blocked by required conditions
Tests / web-coverage (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
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 }}) (flutter, flutter-analyze, ) (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,flutter-analyze) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / lock-popup-safety (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (0) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (1) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (2) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (3) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (4) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (5) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (6) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (7) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (8) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (9) (push) Waiting to run
Tests / flutter-coverage (push) Blocked by required conditions
Tests / web-coverage (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
71a35d6aa1
commit
83a5c6b4bc
@ -111,7 +111,7 @@ class TestAcceptedScreen:
|
||||
assert locker.workout_data["source"] == "Workout A"
|
||||
delay, callback = locker.root.after.call_args.args
|
||||
assert delay > 0
|
||||
assert callback == locker.unlock_screen
|
||||
assert callback.__name__ == "unlock_screen"
|
||||
|
||||
def test_manual_save_paints_the_form_glyph(
|
||||
self, mock_tk: MagicMock, mock_sys_exit: MagicMock, tmp_path: Path
|
||||
@ -143,4 +143,4 @@ class TestGlyphHelpers:
|
||||
def test_entry_glyphs_maps_known_and_unknown_types(self) -> None:
|
||||
"""Known types get their glyph; an unknown one shows a tick, in order."""
|
||||
assert g.entry_glyphs(("runnerup_verified", "mystery")) == f"{g.RUN} {g.OK}"
|
||||
assert g.entry_glyphs(()) == ""
|
||||
assert not g.entry_glyphs(())
|
||||
|
||||
@ -52,23 +52,17 @@ def _widget_texts(widget: tk.Misc) -> list[str]:
|
||||
# cget("text") would answer its textvariable's *name*.)
|
||||
if widget.winfo_class() in _TYPED:
|
||||
return out
|
||||
try:
|
||||
text = str(widget.cget("text"))
|
||||
except tk.TclError:
|
||||
text = ""
|
||||
try:
|
||||
var = str(widget.cget("textvariable"))
|
||||
except tk.TclError:
|
||||
var = ""
|
||||
# Ask only for options the widget has: no try/except, nothing swallowed.
|
||||
options = set(widget.keys())
|
||||
text = str(widget.cget("text")) if "text" in options else ""
|
||||
var = str(widget.cget("textvariable")) if "textvariable" in options else ""
|
||||
if var:
|
||||
text = f"{text} {widget.getvar(var)}"
|
||||
if widget.winfo_class() == "Menu":
|
||||
last = widget.index("end")
|
||||
for i in range(0 if last is None else int(last) + 1):
|
||||
try:
|
||||
if widget.type(i) not in {"separator", "tearoff"}:
|
||||
text += " " + str(widget.entrycget(i, "label"))
|
||||
except tk.TclError:
|
||||
continue
|
||||
return [text, *out] if text.strip() else out
|
||||
|
||||
|
||||
@ -94,7 +88,7 @@ def _paint_all(root: tk.Tk, shots: Path | None) -> dict[str, list[str]]:
|
||||
builds = [
|
||||
(s.name, lambda surface, p=s.paint: p(ScreenHost(surface))) for s in SCREENS
|
||||
]
|
||||
builds += [(name, build) for name, build in EXTRA_SCREENS]
|
||||
builds += list(EXTRA_SCREENS)
|
||||
builds += extra_paints()
|
||||
bad: dict[str, list[str]] = {}
|
||||
for name, build in builds:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user