Updated to new Action tasks

This commit is contained in:
Joel Collins 2020-05-12 11:29:53 +01:00
parent 28e555ad9b
commit eaf4cf09f5
9 changed files with 27 additions and 65 deletions

View file

@ -1,7 +1,6 @@
from openflexure_microscope.devel import (
JsonResponse,
request,
taskify,
update_task_progress,
)
@ -22,7 +21,6 @@ from labthings.server.utilities import description_from_view
from labthings.server.decorators import (
ThingAction,
ThingProperty,
marshal_task,
marshal_with,
pre_dump,
)
@ -142,19 +140,16 @@ default_zip_manager = ZipManager()
@ThingAction
class ZipBuilderAPIView(View):
@marshal_task
def post(self):
ids = list(JsonResponse(request).json)
microscope = find_component("org.openflexure.microscope")
task = taskify(default_zip_manager.marshaled_build_zip_from_capture_ids)(
# Return a handle on the autofocus task
return default_zip_manager.marshaled_build_zip_from_capture_ids(
microscope, ids
)
# Return a handle on the autofocus task
return task
@ThingProperty
class ZipListAPIView(View):