Dump this tasks's fields to a backup file
(self)
| 505 | return False |
| 506 | |
| 507 | def write_backup_file(self): |
| 508 | """Dump this tasks's fields to a backup file""" |
| 509 | with open(self.data_path("backup.json"), "w") as f: |
| 510 | f.write(json.dumps({ |
| 511 | 'name': self.name, |
| 512 | 'processing_time': self.processing_time, |
| 513 | 'options': self.options, |
| 514 | 'created_at': self.created_at.astimezone(timezone.utc).timestamp(), |
| 515 | 'public': self.public, |
| 516 | 'resize_to': self.resize_to, |
| 517 | 'potree_scene': self.potree_scene, |
| 518 | 'tags': self.tags, |
| 519 | 'crop': json.loads(self.crop.geojson) if self.crop is not None else None, |
| 520 | })) |
| 521 | |
| 522 | def read_backup_file(self): |
| 523 | """Set this tasks fields based on the backup file (but don't save)""" |
no test coverage detected