Put the since-when suffix in since, so its own test covers it

This commit is contained in:
2026-11-19 01:59:18 +01:00
parent 07ef481c51
commit 3e2e0ae5bf
2 changed files with 10 additions and 4 deletions
+3 -4
View File
@@ -10,9 +10,9 @@ from failure import Failure
def since(folder: pathlib.Path, chunk: Parked) -> str:
"""When the chunk parked on what its file says it awaits, to the minute in the machine's time zone: the file is written once per gate, so its time is when the gate began. Empty where the file cannot be read."""
"""`, since <time>`, the time the chunk parked on what its file says it awaits, to the minute in the machine's time zone: the file is written once per gate, so its time is when the gate began. Empty where the file cannot be read."""
try:
return datetime.datetime.fromtimestamp(file_of(folder, chunk.issue).stat().st_mtime).strftime("%Y-%m-%d %H:%M")
return f", since {datetime.datetime.fromtimestamp(file_of(folder, chunk.issue).stat().st_mtime).strftime('%Y-%m-%d %H:%M')}"
except OSError:
return ""
@@ -31,8 +31,7 @@ def lines(key: str, home: pathlib.Path, issues: list[EpicIssue], run: tmux.Tmux)
reasons = {wait.issue: wait.reason for wait in waits}
for chunk in found:
if chunk.issue in parked:
gate = since(folder, parked[chunk.issue])
when = f", since {gate}" if gate else ""
when = since(folder, parked[chunk.issue])
reasons[chunk.issue] = parked[chunk.issue].waits(live[chunk.issue].awaits) + when if chunk.issue in live else f"{parked[chunk.issue].waits('')}{when}, and its window stopped; {again}"
elif chunk.issue not in live:
reasons[chunk.issue] = f"its window stopped; {again}" if chunk.issue in {window.name for window in windows} else f"it has not started; `do-epic {key}` starts it once the epic and its repo have room"