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