Append a single lesson to the store.
(self, lesson: LessonEntry)
| 360 | return self._lessons_path |
| 361 | |
| 362 | def append(self, lesson: LessonEntry) -> None: |
| 363 | """Append a single lesson to the store.""" |
| 364 | with self._lessons_path.open("a", encoding="utf-8") as f: |
| 365 | f.write(json.dumps(lesson.to_dict(), ensure_ascii=False) + "\n") |
| 366 | |
| 367 | def append_many(self, lessons: list[LessonEntry]) -> None: |
| 368 | """Append multiple lessons atomically.""" |