Coverage for src/retrospeedlab/lake/relay/cursor.py: 100%
7 statements
« prev ^ index » next coverage.py v7.16.2, created at 2026-12-03 23:09 +0000
« prev ^ index » next coverage.py v7.16.2, created at 2026-12-03 23:09 +0000
1from pathlib import Path
4def read_cursor(path: Path) -> int:
5 return int(path.read_text(encoding="utf-8").strip())
8def write_cursor(path: Path, cursor: int) -> None:
9 staged = path.with_suffix(".tmp")
10 staged.write_text(f"{cursor}\n", encoding="utf-8")
11 staged.replace(path)