Loading openflexure_microscope/api/utilities.py +8 −2 Original line number Diff line number Diff line Loading @@ -2,13 +2,19 @@ import logging from werkzeug.exceptions import BadRequest from flask import url_for, Blueprint def blueprint_for_module(module_name, api_ver=2, suffix=""): return Blueprint(blueprint_name_for_module(module_name, api_ver=api_ver, suffix=suffix), module_name) return Blueprint( blueprint_name_for_module(module_name, api_ver=api_ver, suffix=suffix), module_name, ) def blueprint_name_for_module(module_name, api_ver=2, suffix=""): bp_name = module_name.split('.')[-1] bp_name = module_name.split(".")[-1] return f"v{api_ver}_{bp_name}_blueprint{suffix}" class JsonResponse: def __init__(self, request): """ Loading openflexure_microscope/api/v2/blueprints/actions/__init__.py +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ from openflexure_microscope.api.views import MicroscopeView from . import camera, stage, system class ActionsAPI(MicroscopeView): def get(self): return jsonify(actions_representation()) Loading openflexure_microscope/api/v2/blueprints/actions/camera.py +3 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ class CaptureAPI(MicroscopeView): """ Create a new image capture. """ def post(self): """ Create a new image capture. Loading Loading @@ -107,6 +108,7 @@ class GPUPreviewStartAPI(MicroscopeView): """ Start the onboard GPU preview. """ def post(self, operation): """ Start the onboard GPU preview. Loading Loading @@ -152,6 +154,7 @@ class GPUPreviewStopAPI(MicroscopeView): """ Stop the onboard GPU preview. """ def post(self, operation): """ Stop the onboard GPU preview. Loading openflexure_microscope/api/v2/blueprints/actions/stage.py +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ class MoveStageAPI(MicroscopeView): """ Handle stage movements. """ def post(self): """ Set x, y and z positions of the stage. Loading openflexure_microscope/api/v2/blueprints/actions/system.py +2 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ class ShutdownAPI(MicroscopeView): """ Attempt to shutdown the device """ def post(self): """ Attempt to shutdown the device Loading @@ -23,6 +24,7 @@ class RebootAPI(MicroscopeView): """ Attempt to reboot the device """ def post(self): """ Attempt to shutdown the device Loading Loading
openflexure_microscope/api/utilities.py +8 −2 Original line number Diff line number Diff line Loading @@ -2,13 +2,19 @@ import logging from werkzeug.exceptions import BadRequest from flask import url_for, Blueprint def blueprint_for_module(module_name, api_ver=2, suffix=""): return Blueprint(blueprint_name_for_module(module_name, api_ver=api_ver, suffix=suffix), module_name) return Blueprint( blueprint_name_for_module(module_name, api_ver=api_ver, suffix=suffix), module_name, ) def blueprint_name_for_module(module_name, api_ver=2, suffix=""): bp_name = module_name.split('.')[-1] bp_name = module_name.split(".")[-1] return f"v{api_ver}_{bp_name}_blueprint{suffix}" class JsonResponse: def __init__(self, request): """ Loading
openflexure_microscope/api/v2/blueprints/actions/__init__.py +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ from openflexure_microscope.api.views import MicroscopeView from . import camera, stage, system class ActionsAPI(MicroscopeView): def get(self): return jsonify(actions_representation()) Loading
openflexure_microscope/api/v2/blueprints/actions/camera.py +3 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ class CaptureAPI(MicroscopeView): """ Create a new image capture. """ def post(self): """ Create a new image capture. Loading Loading @@ -107,6 +108,7 @@ class GPUPreviewStartAPI(MicroscopeView): """ Start the onboard GPU preview. """ def post(self, operation): """ Start the onboard GPU preview. Loading Loading @@ -152,6 +154,7 @@ class GPUPreviewStopAPI(MicroscopeView): """ Stop the onboard GPU preview. """ def post(self, operation): """ Stop the onboard GPU preview. Loading
openflexure_microscope/api/v2/blueprints/actions/stage.py +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ class MoveStageAPI(MicroscopeView): """ Handle stage movements. """ def post(self): """ Set x, y and z positions of the stage. Loading
openflexure_microscope/api/v2/blueprints/actions/system.py +2 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ class ShutdownAPI(MicroscopeView): """ Attempt to shutdown the device """ def post(self): """ Attempt to shutdown the device Loading @@ -23,6 +24,7 @@ class RebootAPI(MicroscopeView): """ Attempt to reboot the device """ def post(self): """ Attempt to shutdown the device Loading