mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-11 13:47:43 +01:00
sickdays: per-date pool, no cap or reason, add/remove today or later only, import_legacy for the migration. LWW state flip per date (no tombstones), Firebase RTDB sickdays-sync/devices/<uuid>/sick_days.json, HMAC audit trail. Readers fail closed (unreadable pool = not sick, logged); writers refuse a corrupt pool. Free-day cross-check via a lazily imported freedays predicate. earned_time: resolve(..., sick=True) floors the final shutdown at 20:00 (capped at the ceiling); gaming, terms and base unchanged. Result dataclasses moved to _resolution.py for the line cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xfj1sxKH9VBPqpcAni8Jry
23 lines
674 B
Python
23 lines
674 B
Python
# Copyright (c) 2026 Krzysztof Rudnicki
|
|
"""The one stdout/stderr sink every ``sickdays`` subcommand writes through.
|
|
|
|
A thin wrapper over ``sys.stdout.write`` (the shape diet-guard and home-guard
|
|
already use) so genuine CLI output does not trip ruff's ``T201`` without a
|
|
suppression. Kept deliberately trivial: ``T201`` is *auto-fixable*, and its
|
|
unsafe fix deletes the whole ``print`` call -- output and all.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
|
|
|
|
def emit(text: str = "") -> None:
|
|
"""Write one line to stdout."""
|
|
sys.stdout.write(f"{text}\n")
|
|
|
|
|
|
def emit_error(text: str) -> None:
|
|
"""Write one line to stderr."""
|
|
sys.stderr.write(f"{text}\n")
|