MCPcopy Create free account
hub / github.com/WebODM/WebODM / handle_task_completed

Function handle_task_completed

coreplugins/tasknotification/signals.py:13–30  ·  view source on GitHub ↗
(sender, task_id, **kwargs)

Source from the content-addressed store, hash-verified

11
12@receiver(task_completed)
13def handle_task_completed(sender, task_id, **kwargs):
14 if get_current_plugin(only_active=True) is None:
15 return
16
17 logger.info("TaskNotification: Task Completed")
18
19 config_data = config.load()
20 if config_data.get("notify_task_completed") == True:
21 task = Task.objects.get(id=task_id)
22 setting = Setting.objects.first()
23 notification_app_name = config_data['notification_app_name'] or settings.app_name
24
25 console_output = reverse_output(task.console.output())
26 notification.send(
27 f"{notification_app_name} - {task.project.name} Task Completed",
28 f"{task.project.name}\n{task.name} Completed\nProcessing time:{hours_minutes_secs(task.processing_time)}\n\nConsole Output:{console_output}",
29 config_data
30 )
31
32@receiver(task_removed)
33def handle_task_removed(sender, task_id, **kwargs):

Callers

nothing calls this directly

Calls 6

get_current_pluginFunction · 0.90
reverse_outputFunction · 0.85
hours_minutes_secsFunction · 0.85
firstMethod · 0.80
getMethod · 0.45
outputMethod · 0.45

Tested by

no test coverage detected