Fixed broken references to capture list

This commit is contained in:
Joel Collins 2020-04-28 14:47:22 +01:00
parent 45ee112e6f
commit a34214b9fb
5 changed files with 29 additions and 17 deletions

View file

@ -100,7 +100,7 @@ class CaptureList(View):
List all image captures
"""
microscope = find_component("org.openflexure.microscope")
image_list = microscope.camera.images.values()
image_list = microscope.captures.images.values()
return image_list
@ -112,7 +112,7 @@ class CaptureView(View):
Description of a single image capture
"""
microscope = find_component("org.openflexure.microscope")
capture_obj = microscope.camera.images.get(id)
capture_obj = microscope.captures.images.get(id)
if not capture_obj:
return abort(404) # 404 Not Found
@ -124,7 +124,7 @@ class CaptureView(View):
Delete a single image capture
"""
microscope = find_component("org.openflexure.microscope")
capture_obj = microscope.camera.images.get(id)
capture_obj = microscope.captures.images.get(id)
if not capture_obj:
return abort(404) # 404 Not Found
@ -132,7 +132,7 @@ class CaptureView(View):
# Delete the capture file
capture_obj.delete()
# Delete from capture list
del microscope.camera.images[id]
del microscope.captures.images[id]
return "", 204
@ -145,7 +145,7 @@ class CaptureDownload(View):
Image data for a single image capture
"""
microscope = find_component("org.openflexure.microscope")
capture_obj = microscope.camera.images.get(id)
capture_obj = microscope.captures.images.get(id)
if not capture_obj:
return abort(404) # 404 Not Found
@ -180,7 +180,7 @@ class CaptureTags(View):
Get tags associated with a single image capture
"""
microscope = find_component("org.openflexure.microscope")
capture_obj = microscope.camera.images.get(id)
capture_obj = microscope.captures.images.get(id)
if not capture_obj:
return abort(404) # 404 Not Found
@ -192,7 +192,7 @@ class CaptureTags(View):
Add tags to a single image capture
"""
microscope = find_component("org.openflexure.microscope")
capture_obj = microscope.camera.images.get(id)
capture_obj = microscope.captures.images.get(id)
if not capture_obj:
return abort(404) # 404 Not Found
@ -212,7 +212,7 @@ class CaptureTags(View):
Delete tags from a single image capture
"""
microscope = find_component("org.openflexure.microscope")
capture_obj = microscope.camera.images.get(id)
capture_obj = microscope.captures.images.get(id)
if not capture_obj:
return abort(404) # 404 Not Found
@ -235,7 +235,7 @@ class CaptureAnnotations(View):
Get annotations associated with a single image capture
"""
microscope = find_component("org.openflexure.microscope")
capture_obj = microscope.camera.images.get(id)
capture_obj = microscope.captures.images.get(id)
if not capture_obj:
return abort(404) # 404 Not Found
@ -247,7 +247,7 @@ class CaptureAnnotations(View):
Update metadata for a single image capture
"""
microscope = find_component("org.openflexure.microscope")
capture_obj = microscope.camera.images.get(id)
capture_obj = microscope.captures.images.get(id)
if not capture_obj:
return abort(404) # 404 Not Found