Commit b430a2d3 authored by Joel Collins's avatar Joel Collins
Browse files

Blackened

parent 36f195d6
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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):
        """
+1 −0
Original line number Diff line number Diff line
@@ -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())
+3 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ class CaptureAPI(MicroscopeView):
    """
    Create a new image capture. 
    """

    def post(self):
        """
        Create a new image capture.
@@ -107,6 +108,7 @@ class GPUPreviewStartAPI(MicroscopeView):
    """
    Start the onboard GPU preview.
    """

    def post(self, operation):
        """
        Start the onboard GPU preview.
@@ -152,6 +154,7 @@ class GPUPreviewStopAPI(MicroscopeView):
    """
    Stop the onboard GPU preview.
    """

    def post(self, operation):
        """
        Stop the onboard GPU preview.
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ class MoveStageAPI(MicroscopeView):
    """
    Handle stage movements. 
    """

    def post(self):
        """
        Set x, y and z positions of the stage.
+2 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ class ShutdownAPI(MicroscopeView):
    """
    Attempt to shutdown the device 
    """

    def post(self):
        """
        Attempt to shutdown the device
@@ -23,6 +24,7 @@ class RebootAPI(MicroscopeView):
    """
    Attempt to reboot the device 
    """

    def post(self):
        """
        Attempt to shutdown the device
Loading