Updated to new Action tasks
This commit is contained in:
parent
28e555ad9b
commit
eaf4cf09f5
9 changed files with 27 additions and 65 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue