Commit 4e7606aa authored by Joel Collins's avatar Joel Collins
Browse files

Blackened files

parent be5ddb76
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -61,9 +61,7 @@ class MyPluginClass(MicroscopePlugin):
            for _ in range(n_images):

                # Create a data stream to capture to
                output = self.microscope.camera.new_image(
                    temporary=False
                )
                output = self.microscope.camera.new_image(temporary=False)

                # Capture a still image from the Pi camera, into the data stream
                self.microscope.camera.capture(output.file, use_video_port=True)
+4 −5
Original line number Diff line number Diff line
@@ -39,10 +39,8 @@ class SnapshotAPI(MicroscopeView):
        # Restart stream worker thread
        self.microscope.camera.start_worker()

        return Response(
            self.microscope.camera.get_frame(),
            mimetype="image/jpeg",
        )
        return Response(self.microscope.camera.get_frame(), mimetype="image/jpeg")


class StateAPI(MicroscopeView):
    def get(self):
@@ -240,7 +238,8 @@ def construct_blueprint(microscope_obj):
    )

    blueprint.add_url_rule(
        "/snapshot", view_func=SnapshotAPI.as_view("snapshot", microscope=microscope_obj)
        "/snapshot",
        view_func=SnapshotAPI.as_view("snapshot", microscope=microscope_obj),
    )

    blueprint.add_url_rule(
+2 −6
Original line number Diff line number Diff line
@@ -134,12 +134,8 @@ def construct_blueprint(microscope_obj):

    blueprint = Blueprint("task_blueprint", __name__)

    blueprint.add_url_rule(
        "/", view_func=TaskListAPI.as_view("task_list")
    )
    blueprint.add_url_rule("/", view_func=TaskListAPI.as_view("task_list"))

    blueprint.add_url_rule(
        "/<task_id>/", view_func=TaskAPI.as_view("task")
    )
    blueprint.add_url_rule("/<task_id>/", view_func=TaskAPI.as_view("task"))

    return blueprint
+4 −9
Original line number Diff line number Diff line
@@ -120,15 +120,10 @@ class BaseCamera(metaclass=ABCMeta):
        self.stream_timeout = 20
        self.stream_timeout_enabled = False

        self.state = {
            "board": None
        }
        self.state = {"board": None}

        # TODO: Load/save these to config
        self.paths = {
            "default": BASE_CAPTURE_PATH,
            "temp": TEMP_CAPTURE_PATH
        }
        self.paths = {"default": BASE_CAPTURE_PATH, "temp": TEMP_CAPTURE_PATH}

        # Capture data
        self.images = []
@@ -296,7 +291,7 @@ class BaseCamera(metaclass=ABCMeta):
        output = CaptureObject(filepath=filepath)
        # Insert a temporary tag if temporary
        if temporary:
            output.put_tags(['temporary'])
            output.put_tags(["temporary"])

        # Update capture list
        self.images.append(output)
@@ -339,7 +334,7 @@ class BaseCamera(metaclass=ABCMeta):
        output = CaptureObject(filepath=filepath)
        # Insert a temporary tag if temporary
        if temporary:
            output.put_tags(['temporary'])
            output.put_tags(["temporary"])

        # Update capture list
        self.videos.append(output)
+2 −2
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ def pull_usercomment_dict(filepath):
    try:
        exif_dict = piexif.load(filepath)
    except InvalidImageDataError:
        logging.error("Invalid data at {}. Skipping.".format(filepath))
        logging.warning("Invalid data at {}. Skipping.".format(filepath))
        return None
    if "Exif" in exif_dict and 37510 in exif_dict["Exif"]:
        return yaml.load(exif_dict["Exif"][37510].decode())
Loading