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

Method delete

app/models/task.py:1391–1410  ·  view source on GitHub ↗
(self, using=None, keep_parents=False)

Source from the content-addressed store, hash-verified

1389 return entry
1390
1391 def delete(self, using=None, keep_parents=False):
1392 task_id = self.id
1393 from app.plugins import signals as plugin_signals
1394 plugin_signals.task_removing.send_robust(sender=self.__class__, task_id=task_id)
1395
1396 directory_to_delete = os.path.join(settings.MEDIA_ROOT,
1397 task_directory_path(self.id, self.project.id))
1398 self.clear_task_assets_cache()
1399
1400 super(Task, self).delete(using, keep_parents)
1401
1402 # Remove files related to this task
1403 try:
1404 shutil.rmtree(directory_to_delete)
1405 except FileNotFoundError as e:
1406 logger.warning(e)
1407
1408 self.project.owner.profile.clear_used_quota_cache()
1409
1410 plugin_signals.task_removed.send_robust(sender=self.__class__, task_id=task_id)
1411
1412 def compact(self):
1413 # Remove all images

Callers 15

processMethod · 0.95
removeMethod · 0.45
$eFunction · 0.45
vsFunction · 0.45
stopFunction · 0.45
cleanupFunction · 0.45
cleanup_projectsFunction · 0.45
cleanup_tasksFunction · 0.45
process_taskFunction · 0.45
check_quotasFunction · 0.45
add_default_presetsFunction · 0.45
doneDeletingMethod · 0.45

Calls 3

task_directory_pathFunction · 0.85

Tested by 10

test_projectMethod · 0.36
setUpMethod · 0.36
test_basemapMethod · 0.36
test_mediaMethod · 0.36
test_worker_tasksMethod · 0.36
test_userMethod · 0.36
test_groupMethod · 0.36
test_processingnodesMethod · 0.36
test_presetMethod · 0.36