Loading openflexure_microscope/api/app.py +5 −1 Original line number Diff line number Diff line Loading @@ -79,16 +79,20 @@ for extension in find_extensions(USER_EXTENSIONS_PATH): # Attach captures resources labthing.add_view(views.CaptureList, f"/captures") labthing.add_view(views.CaptureResource, f"/captures/<id>") labthing.add_root_link(views.CaptureList, "captures") labthing.add_view(views.CaptureView, f"/captures/<id>") labthing.add_view(views.CaptureDownload, f"/captures/<id>/download/<filename>") labthing.add_view(views.CaptureTags, f"/captures/<id>/tags") labthing.add_view(views.CaptureMetadata, f"/captures/<id>/metadata") # Attach settings and status resources labthing.add_view(views.SettingsProperty, f"/settings") labthing.add_root_link(views.SettingsProperty, "settings") labthing.add_view(views.NestedSettingsProperty, "/settings/<path:route>") labthing.add_view(views.StatusProperty, "/status") labthing.add_view(views.NestedStatusProperty, "/status/<path:route>") labthing.add_root_link(views.StatusProperty, "status") # Attach streams resources labthing.add_view(views.MjpegStream, f"/streams/mjpeg") Loading openflexure_microscope/api/default_extensions/autofocus.py +4 −4 Original line number Diff line number Diff line from openflexure_microscope.common.flask_labthings.find import find_component from openflexure_microscope.common.flask_labthings.extensions import BaseExtension from openflexure_microscope.common.flask_labthings.resource import Resource from openflexure_microscope.common.flask_labthings.view import View from openflexure_microscope.common.flask_labthings.decorators import ( ThingAction, ThingProperty, Loading Loading @@ -292,7 +292,7 @@ def fast_up_down_up_autofocus( return m.data_dict() class MeasureSharpnessAPI(Resource): class MeasureSharpnessAPI(View): def post(self): microscope = find_component("org.openflexure.microscope") Loading @@ -303,7 +303,7 @@ class MeasureSharpnessAPI(Resource): @ThingAction class AutofocusAPI(Resource): class AutofocusAPI(View): """ Run a standard autofocus """ Loading @@ -330,7 +330,7 @@ class AutofocusAPI(Resource): @ThingAction class FastAutofocusAPI(Resource): class FastAutofocusAPI(View): """ Run a fast autofocus """ Loading openflexure_microscope/api/default_extensions/scan.py +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ from openflexure_microscope.common.flask_labthings import fields from openflexure_microscope.devel import taskify, abort, update_task_progress from openflexure_microscope.common.flask_labthings.resource import Resource from openflexure_microscope.common.flask_labthings.view import View import time Loading Loading @@ -341,7 +341,7 @@ def stack( @ThingAction class TileScanAPI(Resource): class TileScanAPI(View): @use_args( { "filename": fields.String(), Loading openflexure_microscope/api/default_extensions/zip_builder.py +4 −4 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ import tempfile import logging from openflexure_microscope.common.flask_labthings.find import find_component from openflexure_microscope.common.flask_labthings.resource import Resource from openflexure_microscope.common.flask_labthings.view import View from openflexure_microscope.common.flask_labthings.extensions import BaseExtension from openflexure_microscope.common.flask_labthings.decorators import ( ThingAction, Loading Loading @@ -96,7 +96,7 @@ default_zip_manager = ZipManager() @ThingAction class ZipBuilderAPIView(Resource): class ZipBuilderAPIView(View): def post(self): ids = list(JsonResponse(request).json) Loading @@ -109,12 +109,12 @@ class ZipBuilderAPIView(Resource): @ThingProperty class ZipListAPIView(Resource): class ZipListAPIView(View): def get(self): return jsonify(default_zip_manager.session_zips) class ZipGetterAPIView(Resource): class ZipGetterAPIView(View): def get(self, session_id): if not session_id in default_zip_manager.session_zips: return abort(404) # 404 Not Found Loading openflexure_microscope/api/example_extensions/ev_gui.py +3 −3 Original line number Diff line number Diff line from openflexure_microscope.common.flask_labthings.resource import Resource from openflexure_microscope.common.flask_labthings.view import View from openflexure_microscope.common.flask_labthings.extensions import BaseExtension from openflexure_microscope.common.flask_labthings.decorators import ( ThingAction, Loading Loading @@ -77,7 +77,7 @@ static_form = { @ThingProperty class TestAPIView(Resource): class TestAPIView(View): def get(self): global val_int val_int += 1 Loading @@ -85,7 +85,7 @@ class TestAPIView(Resource): @ThingAction class TestDoAPIView(Resource): class TestDoAPIView(View): def post(self): global val_int val_int += 1 Loading Loading
openflexure_microscope/api/app.py +5 −1 Original line number Diff line number Diff line Loading @@ -79,16 +79,20 @@ for extension in find_extensions(USER_EXTENSIONS_PATH): # Attach captures resources labthing.add_view(views.CaptureList, f"/captures") labthing.add_view(views.CaptureResource, f"/captures/<id>") labthing.add_root_link(views.CaptureList, "captures") labthing.add_view(views.CaptureView, f"/captures/<id>") labthing.add_view(views.CaptureDownload, f"/captures/<id>/download/<filename>") labthing.add_view(views.CaptureTags, f"/captures/<id>/tags") labthing.add_view(views.CaptureMetadata, f"/captures/<id>/metadata") # Attach settings and status resources labthing.add_view(views.SettingsProperty, f"/settings") labthing.add_root_link(views.SettingsProperty, "settings") labthing.add_view(views.NestedSettingsProperty, "/settings/<path:route>") labthing.add_view(views.StatusProperty, "/status") labthing.add_view(views.NestedStatusProperty, "/status/<path:route>") labthing.add_root_link(views.StatusProperty, "status") # Attach streams resources labthing.add_view(views.MjpegStream, f"/streams/mjpeg") Loading
openflexure_microscope/api/default_extensions/autofocus.py +4 −4 Original line number Diff line number Diff line from openflexure_microscope.common.flask_labthings.find import find_component from openflexure_microscope.common.flask_labthings.extensions import BaseExtension from openflexure_microscope.common.flask_labthings.resource import Resource from openflexure_microscope.common.flask_labthings.view import View from openflexure_microscope.common.flask_labthings.decorators import ( ThingAction, ThingProperty, Loading Loading @@ -292,7 +292,7 @@ def fast_up_down_up_autofocus( return m.data_dict() class MeasureSharpnessAPI(Resource): class MeasureSharpnessAPI(View): def post(self): microscope = find_component("org.openflexure.microscope") Loading @@ -303,7 +303,7 @@ class MeasureSharpnessAPI(Resource): @ThingAction class AutofocusAPI(Resource): class AutofocusAPI(View): """ Run a standard autofocus """ Loading @@ -330,7 +330,7 @@ class AutofocusAPI(Resource): @ThingAction class FastAutofocusAPI(Resource): class FastAutofocusAPI(View): """ Run a fast autofocus """ Loading
openflexure_microscope/api/default_extensions/scan.py +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ from openflexure_microscope.common.flask_labthings import fields from openflexure_microscope.devel import taskify, abort, update_task_progress from openflexure_microscope.common.flask_labthings.resource import Resource from openflexure_microscope.common.flask_labthings.view import View import time Loading Loading @@ -341,7 +341,7 @@ def stack( @ThingAction class TileScanAPI(Resource): class TileScanAPI(View): @use_args( { "filename": fields.String(), Loading
openflexure_microscope/api/default_extensions/zip_builder.py +4 −4 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ import tempfile import logging from openflexure_microscope.common.flask_labthings.find import find_component from openflexure_microscope.common.flask_labthings.resource import Resource from openflexure_microscope.common.flask_labthings.view import View from openflexure_microscope.common.flask_labthings.extensions import BaseExtension from openflexure_microscope.common.flask_labthings.decorators import ( ThingAction, Loading Loading @@ -96,7 +96,7 @@ default_zip_manager = ZipManager() @ThingAction class ZipBuilderAPIView(Resource): class ZipBuilderAPIView(View): def post(self): ids = list(JsonResponse(request).json) Loading @@ -109,12 +109,12 @@ class ZipBuilderAPIView(Resource): @ThingProperty class ZipListAPIView(Resource): class ZipListAPIView(View): def get(self): return jsonify(default_zip_manager.session_zips) class ZipGetterAPIView(Resource): class ZipGetterAPIView(View): def get(self, session_id): if not session_id in default_zip_manager.session_zips: return abort(404) # 404 Not Found Loading
openflexure_microscope/api/example_extensions/ev_gui.py +3 −3 Original line number Diff line number Diff line from openflexure_microscope.common.flask_labthings.resource import Resource from openflexure_microscope.common.flask_labthings.view import View from openflexure_microscope.common.flask_labthings.extensions import BaseExtension from openflexure_microscope.common.flask_labthings.decorators import ( ThingAction, Loading Loading @@ -77,7 +77,7 @@ static_form = { @ThingProperty class TestAPIView(Resource): class TestAPIView(View): def get(self): global val_int val_int += 1 Loading @@ -85,7 +85,7 @@ class TestAPIView(Resource): @ThingAction class TestDoAPIView(Resource): class TestDoAPIView(View): def post(self): global val_int val_int += 1 Loading