From 4f2cf79a26e1028ba8cd529826b538c7fc81b68c Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Tue, 19 Feb 2019 16:12:14 +0000 Subject: [PATCH] Task route now returns a dictionary with task ID as key --- openflexure_microscope/task.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/task.py b/openflexure_microscope/task.py index 5575c430..526cb91f 100644 --- a/openflexure_microscope/task.py +++ b/openflexure_microscope/task.py @@ -21,7 +21,12 @@ class TaskOrchestrator: """ Returns a list of dictionary representations of all tasks in the session. """ - return [task.state for task in self.tasks] + state = {} + + for task in self.tasks: + state[task.id] = task.state + + return state def task_from_id(self, task_id: str): """