Convert this History into a JSON string for use in persistent history files.
(self)
| 340 | return results |
| 341 | |
| 342 | def to_json(self) -> str: |
| 343 | """Convert this History into a JSON string for use in persistent history files.""" |
| 344 | json_dict = { |
| 345 | History._history_version_field: History._history_version, |
| 346 | History._history_items_field: [hi.to_dict() for hi in self], |
| 347 | } |
| 348 | return json.dumps(json_dict, ensure_ascii=False, indent=2) |
| 349 | |
| 350 | @staticmethod |
| 351 | def from_json(history_json: str) -> "History": |