--absolute asks for another form of time, not for one fewer fact

A never-heard node has no instant to print, so the timestamp language dropped
"never" back to the plain absent token and a contacts listing under --absolute
could no longer tell "we have not heard from it" from "this row has no heard
time". The absent word survives the switch; only the form of a real time changes.

Also drops a dead guard in the preferences writer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jean-Pierre MartineauandClaude Opus 5 committed 2026-09-08 04:07:27 -04:00
1 parent de0f60cbe0
commit 8d2a7b8281
3 files changed
+15 -6

No files matched your search

+1 -1
View File
@@ -125,7 +125,7 @@ class PreferencesTool(Tool):
if changes:
prefs.save()
if scripted and applied is not None and any(op[0] in ("set", "reset") for op in ops):
if scripted and any(op[0] in ("set", "reset") for op in ops):
blocks.append(_written(applied, prefs))
plural = "" if changes == 1 else "s"
+11 -4
View File
@@ -451,10 +451,17 @@ def _flag_cell(value: bool | None) -> str:
def _time(value: Any, *, absent: str) -> str:
"""Render a time in whichever language this run speaks (see :func:`when`)."""
if isinstance(value, datetime) or value is None:
return script.stamp(value) if _absolute() else script.age(value, absent=absent)
return normalise(value) # pragma: no cover - a row holding something else is a bug
"""Render a time in whichever language this run speaks (see :func:`when`).
``absent`` survives the switch to timestamps, because it is not a rendering choice:
``never`` says the event has not happened, and ``--absolute`` was asked for a different
*form* of time, not for one fewer fact.
"""
if not isinstance(value, datetime) and value is not None:
return normalise(value) # pragma: no cover - a row holding something else is a bug
if value is None:
return absent
return script.stamp(value) if _absolute() else script.age(value, absent=absent)
def _absolute() -> bool: