(self, log_data)
| 561 | return img |
| 562 | |
| 563 | def _write_to_file(self, log_data): |
| 564 | try: |
| 565 | with self.mapping_file_path.open("r") as f: |
| 566 | existing_log_data = json.load(f) |
| 567 | except (FileNotFoundError, json.JSONDecodeError): |
| 568 | existing_log_data = [] |
| 569 | existing_log_data.append(log_data) |
| 570 | with self.mapping_file_path.open("w") as f: |
| 571 | json.dump(existing_log_data, f, indent=4) |