mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-21 21:32:27 +01:00
sickdays 0.4.0: add focus locker id
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c98da93339
commit
11c5b2e32b
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "sickdays"
|
name = "sickdays"
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
description = "Shared sick-day pool: per-date, uncapped, synced; every gate respects it"
|
description = "Shared sick-day pool: per-date, uncapped, synced; every gate respects it"
|
||||||
requires-python = ">=3.14"
|
requires-python = ">=3.14"
|
||||||
# Deliberately NOT gatelock (its __init__ imports tkinter); the HMAC lives in
|
# Deliberately NOT gatelock (its __init__ imports tkinter); the HMAC lives in
|
||||||
|
|||||||
@ -45,6 +45,7 @@ from sickdays._constants import (
|
|||||||
LOCKER_ALARM,
|
LOCKER_ALARM,
|
||||||
LOCKER_BOOK,
|
LOCKER_BOOK,
|
||||||
LOCKER_DIET,
|
LOCKER_DIET,
|
||||||
|
LOCKER_FOCUS,
|
||||||
LOCKER_LEETCODE,
|
LOCKER_LEETCODE,
|
||||||
LOCKER_WORKOUT,
|
LOCKER_WORKOUT,
|
||||||
LOCKERS,
|
LOCKERS,
|
||||||
@ -70,6 +71,7 @@ __all__ = [
|
|||||||
"LOCKER_ALARM",
|
"LOCKER_ALARM",
|
||||||
"LOCKER_BOOK",
|
"LOCKER_BOOK",
|
||||||
"LOCKER_DIET",
|
"LOCKER_DIET",
|
||||||
|
"LOCKER_FOCUS",
|
||||||
"LOCKER_LEETCODE",
|
"LOCKER_LEETCODE",
|
||||||
"LOCKER_WORKOUT",
|
"LOCKER_WORKOUT",
|
||||||
"AlreadySickError",
|
"AlreadySickError",
|
||||||
|
|||||||
@ -68,10 +68,13 @@ LOCKER_DIET: Final = "diet"
|
|||||||
#: The phone ring, the PC fallback ring, the RTC self-wake and the
|
#: The phone ring, the PC fallback ring, the RTC self-wake and the
|
||||||
#: missed-alarm penalty -- one switch, because they are one alarm.
|
#: missed-alarm penalty -- one switch, because they are one alarm.
|
||||||
LOCKER_ALARM: Final = "alarm"
|
LOCKER_ALARM: Final = "alarm"
|
||||||
|
#: The focus-project daily-minutes lock (focus-guard).
|
||||||
|
LOCKER_FOCUS: Final = "focus"
|
||||||
LOCKERS: Final = (
|
LOCKERS: Final = (
|
||||||
LOCKER_WORKOUT,
|
LOCKER_WORKOUT,
|
||||||
LOCKER_LEETCODE,
|
LOCKER_LEETCODE,
|
||||||
LOCKER_BOOK,
|
LOCKER_BOOK,
|
||||||
LOCKER_DIET,
|
LOCKER_DIET,
|
||||||
LOCKER_ALARM,
|
LOCKER_ALARM,
|
||||||
|
LOCKER_FOCUS,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -18,6 +18,7 @@ from sickdays._constants import (
|
|||||||
LOCKER_ALARM,
|
LOCKER_ALARM,
|
||||||
LOCKER_BOOK,
|
LOCKER_BOOK,
|
||||||
LOCKER_DIET,
|
LOCKER_DIET,
|
||||||
|
LOCKER_FOCUS,
|
||||||
LOCKER_LEETCODE,
|
LOCKER_LEETCODE,
|
||||||
LOCKER_WORKOUT,
|
LOCKER_WORKOUT,
|
||||||
)
|
)
|
||||||
@ -34,6 +35,7 @@ LOCKER_LABELS: Final = {
|
|||||||
LOCKER_BOOK: "Book",
|
LOCKER_BOOK: "Book",
|
||||||
LOCKER_DIET: "Diet",
|
LOCKER_DIET: "Diet",
|
||||||
LOCKER_ALARM: "Wake alarm",
|
LOCKER_ALARM: "Wake alarm",
|
||||||
|
LOCKER_FOCUS: "Focus",
|
||||||
}
|
}
|
||||||
|
|
||||||
SHEET_HELP: Final = (
|
SHEET_HELP: Final = (
|
||||||
|
|||||||
@ -26,6 +26,7 @@ def test_labels_match_the_phone() -> None:
|
|||||||
"Book",
|
"Book",
|
||||||
"Diet",
|
"Diet",
|
||||||
"Wake alarm",
|
"Wake alarm",
|
||||||
|
"Focus",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -200,3 +200,11 @@ def test_the_keep_edit_refusals() -> None:
|
|||||||
remove_sick_day(TOMORROW, now=TODAY)
|
remove_sick_day(TOMORROW, now=TODAY)
|
||||||
with pytest.raises(NotSickError):
|
with pytest.raises(NotSickError):
|
||||||
set_kept_lockers(TOMORROW, ["book"], now=TODAY)
|
set_kept_lockers(TOMORROW, ["book"], now=TODAY)
|
||||||
|
|
||||||
|
|
||||||
|
def test_focus_is_a_locker_a_sick_day_stands_down_unless_kept() -> None:
|
||||||
|
add_sick_day(TOMORROW, now=TODAY)
|
||||||
|
assert stands_down("focus", TOMORROW)
|
||||||
|
set_kept_lockers(TOMORROW, ["focus"], now=TODAY)
|
||||||
|
assert not stands_down("focus", TOMORROW)
|
||||||
|
assert stands_down("workout", TOMORROW)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user