diff --git a/README.md b/README.md index 8e845b0..5802541 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ python -m python_pkg.steam_backlog_enforcer.main setup | `unblock [minutes]` | Unblock the store for a window (default 15, max 30); the daemon keeps it open and re-blocks after | | `buy-dlc` | Same 15-minute store window, to buy a game or DLC | | `reset` | Reset all state | +| `total-block-research --until T` | Root. One window per total block (at most 48 h): Steam and the store open, only Librarian may be played; the daemon re-applies the full block at `T` | | `installed` | List currently installed Steam games | | `uninstall` | Interactively uninstall non-assigned games | | `setup` | First-time configuration | diff --git a/steam_backlog_enforcer/_cmd_total_block_research.py b/steam_backlog_enforcer/_cmd_total_block_research.py new file mode 100644 index 0000000..76abcfc --- /dev/null +++ b/steam_backlog_enforcer/_cmd_total_block_research.py @@ -0,0 +1,71 @@ +"""``total-block-research``: lend Steam for one bounded window, Librarian only. + +kuhy 2026-11-11: game-design research needs "Librarian: Tidy Up the Arcane +Library" actually played during a 6-day total block. This command opens ONE +window per lock, ending at ``--until`` (at most 48 h away, never past the +lock's end, never extended by a rerun). It only validates and records the +window; the enforcer daemon opens Steam within a pass and re-applies the full +block at the deadline (:mod:`steam_backlog_enforcer._research_tick`). + +Root-only: the record sits in a root-only state directory. The lock and its +end date are untouched, so this can never shorten or end a total block. +""" + +from __future__ import annotations + +from datetime import datetime +import os + +from steam_backlog_enforcer import _research_window as window +from steam_backlog_enforcer._echo import _echo + +_USAGE = ( + "Usage: total-block-research --until " + "\n e.g. total-block-research --until 2026-11-13T00:00" + "\n One window per total block, at most 48 h, Librarian only." +) + + +def _until_argument(args: list[str]) -> str | None: + """The value of ``--until X`` or ``--until=X``, or None for any other shape.""" + match args: + case ["--until", value]: + return value + case [single] if single.startswith("--until="): + return single.partition("=")[2] + case _: + return None + + +def cmd_total_block_research(args: list[str]) -> int: + """Open the research window. + + Args: + args: Arguments after the command name: ``--until