(self, tid: int)
| 268 | return max(ids, default=0) + 1 |
| 269 | |
| 270 | def _load(self, tid: int) -> dict: |
| 271 | p = TASKS_DIR / f"task_{tid}.json" |
| 272 | if not p.exists(): raise ValueError(f"Task {tid} not found") |
| 273 | return json.loads(p.read_text()) |
| 274 | |
| 275 | def _save(self, task: dict): |
| 276 | (TASKS_DIR / f"task_{task['id']}.json").write_text(json.dumps(task, indent=2)) |