From 2574e38b47fe76c677f52d552f0300b10834ead4 Mon Sep 17 00:00:00 2001 From: jtc42 Date: Sat, 21 Dec 2019 17:38:29 +0000 Subject: [PATCH] Tidied up --- .../api/v2/views/captures.py | 22 ------------------- .../api/v2/views/streams.py | 14 ------------ 2 files changed, 36 deletions(-) diff --git a/openflexure_microscope/api/v2/views/captures.py b/openflexure_microscope/api/v2/views/captures.py index a8203012..3cc5fb85 100644 --- a/openflexure_microscope/api/v2/views/captures.py +++ b/openflexure_microscope/api/v2/views/captures.py @@ -209,25 +209,3 @@ class CaptureMetadata(Resource): capture_obj.put_metadata(data_dict) return jsonify(capture_obj.metadata) - - -def add_captures_to_labthing(labthing, prefix=""): - """ - Add all capture resources to a labthing - """ - labthing.add_resource(CaptureList, f"{prefix}/captures", endpoint="CaptureList") - labthing.register_property(CaptureList) - labthing.add_resource( - CaptureResource, f"{prefix}/captures/", endpoint="CaptureResource" - ) - labthing.add_resource( - CaptureDownload, - f"{prefix}/captures//download/", - endpoint="CaptureDownload", - ) - labthing.add_resource( - CaptureTags, f"{prefix}/captures//tags", endpoint="CaptureTags" - ) - labthing.add_resource( - CaptureMetadata, f"{prefix}/captures//metadata", endpoint="CaptureMetadata" - ) diff --git a/openflexure_microscope/api/v2/views/streams.py b/openflexure_microscope/api/v2/views/streams.py index fe22c959..962b8cda 100644 --- a/openflexure_microscope/api/v2/views/streams.py +++ b/openflexure_microscope/api/v2/views/streams.py @@ -46,17 +46,3 @@ class SnapshotStream(Resource): microscope.camera.start_worker() return Response(microscope.camera.get_frame(), mimetype="image/jpeg") - - -def add_streams_to_labthing(labthing, prefix=""): - """ - Add all stream resources to a labthing - """ - labthing.add_resource( - MjpegStream, f"{prefix}/streams/mjpeg", endpoint="MjpegStream" - ) - labthing.register_property(MjpegStream) - labthing.add_resource( - SnapshotStream, f"{prefix}/streams/snapshot", endpoint="SnapshotStream" - ) - labthing.register_property(SnapshotStream)