(session: Session, working_dir: WorkingDir, existing_file: File, cascade_archive_tasks: bool = False)
| 63 | |
| 64 | |
| 65 | def remove_core(session: Session, working_dir: WorkingDir, existing_file: File, cascade_archive_tasks: bool = False): |
| 66 | new_file = File.copy_file_from_existing( |
| 67 | session, |
| 68 | working_dir, |
| 69 | existing_file, |
| 70 | remove_link = True, |
| 71 | add_link = False) |
| 72 | |
| 73 | new_file.state = "removed" |
| 74 | new_file.hash_update() |
| 75 | if cascade_archive_tasks: |
| 76 | archive_related_tasks(session, existing_file) |
| 77 | session.add(new_file) |
| 78 | if new_file.type == 'compound': |
| 79 | child_file_list = existing_file.get_child_files(session = session) |
| 80 | for child in child_file_list: |
| 81 | remove_core(session = session, |
| 82 | working_dir = working_dir, |
| 83 | existing_file = child, |
| 84 | cascade_archive_tasks = cascade_archive_tasks) |
| 85 | |
| 86 | return True |
no test coverage detected