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

Method set_alignment_file_from

app/models/task.py:1567–1584  ·  view source on GitHub ↗
(self, align_task)

Source from the content-addressed store, hash-verified

1565 return path_traversal_check(p, self.task_path())
1566
1567 def set_alignment_file_from(self, align_task):
1568 tp = self.task_path()
1569 if not os.path.exists(tp):
1570 os.makedirs(tp, exist_ok=True)
1571
1572 alignment_file = align_task.assets_path(self.ASSETS_MAP['georeferenced_model.laz'])
1573 dst_file = self.task_path("align.laz")
1574
1575 if os.path.exists(dst_file):
1576 os.unlink(dst_file)
1577
1578 if os.path.exists(alignment_file):
1579 try:
1580 os.link(alignment_file, dst_file)
1581 except:
1582 shutil.copy(alignment_file, dst_file)
1583 else:
1584 logger.warn("Cannot set alignment file for {}, {} does not exist".format(self, alignment_file))
1585
1586 def get_check_file_asset_path(self, asset):
1587 file = self.assets_path(self.ASSETS_MAP[asset])

Callers 1

createMethod · 0.80

Calls 5

task_pathMethod · 0.95
existsMethod · 0.80
assets_pathMethod · 0.80
linkMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected