Merge the runner dropping and counting rows without an id, title or link, so no reader skips a listing (wp-rows)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-10-06 14:05:15 +02:00
commit 136047023e
58 files changed
+479 -203

No files matched your search

+17 -3
View File
@@ -10,7 +10,10 @@ both; nothing here decides how a board is read, so the words never disagree
with the pull as long as they read the keys the pull writes.
A word with a number carries it after a colon ("without text: 12"), and the
filter matches the phrase before the colon (`WORDS`).
filter matches the phrase before the colon (`WORDS`). One word is outside
`WORDS`: the listings the last read dropped for want of an id, a title or a
link ("3 listings dropped: no title or link", `_runner.valid`), shown on the
board's row and not offered by the filter.
"""
from __future__ import annotations
@@ -49,7 +52,7 @@ WORDS: dict[str, str] = {
#: The `state` keys `words` reads, `<prefix>:<key>:<target>`.
KEYS = ("failing", "ok", "complete", "swept", "sweep", "filtered", "remote_unasked",
"narrowed", "detailfailed")
"narrowed", "detailfailed", "dropped")
class Texts(NamedTuple):
@@ -84,7 +87,8 @@ def texts(store: Store) -> dict[int, Texts]:
def words(module: ModuleType, state: Mapping[str, str], target: str,
sub: Subscription | None, size: int | None, *, plan: Plan | None = None,
line: str = "", counts: Texts | None = None) -> list[str]:
"""The limits of one board, in the order of `WORDS`, those that apply.
"""The limits of one board, in the order of `WORDS`, those that apply, the
rows the last read dropped after "read incomplete".
`state` holds the board's keys (`state_of`), `size` its kept size,
`plan` and `sub` the reach it is read with (for "read whole"), `line` the
@@ -105,6 +109,8 @@ def words(module: ModuleType, state: Mapping[str, str], target: str,
out.append("failing")
if state.get(key("ok")) and not state.get(key("complete")):
out.append("read incomplete")
if dropped := _count(state.get(key("dropped"))):
out.append(f"{dropped} listing{'' if dropped == 1 else 's'} dropped: no title or link")
if state.get(key("swept")) == "1" or key("sweep") in state:
out.append("swept")
if state.get(key("filtered")) == "1":
@@ -130,6 +136,14 @@ def words(module: ModuleType, state: Mapping[str, str], target: str,
return out
def _count(value: str | None) -> int:
"""A number kept in state, 0 for none or one that does not parse."""
try:
return max(0, int(value or 0))
except ValueError:
return 0
def _whole(reads: Reads, sub: Subscription | None, size: int | None, plan: Plan | None) -> bool:
"""Whether the reach leaves the board unread by place: its reader cannot
filter, or the board is under `SMALL` roles (the line's two "read whole"