MCPcopy Index your code
hub / github.com/WebODM/WebODM / write_backup_file

Method write_backup_file

app/models/task.py:507–520  ·  view source on GitHub ↗

Dump this tasks's fields to a backup file

(self)

Source from the content-addressed store, hash-verified

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)"""

Callers 1

Calls 2

data_pathMethod · 0.95
writeMethod · 0.80

Tested by

no test coverage detected