Switched away from using JSONify

This commit is contained in:
Joel Collins 2020-04-24 16:05:01 +01:00
parent 4fffa1fcba
commit cda5cdbb44
9 changed files with 26 additions and 29 deletions

View file

@ -17,7 +17,7 @@ from openflexure_microscope.api.v2.views.captures import capture_schema
import logging
import io
from flask import jsonify, request, abort, url_for, redirect, send_file
from flask import request, abort, url_for, redirect, send_file
@ThingAction
@ -164,7 +164,7 @@ class GPUPreviewStartAPI(View):
microscope.camera.start_preview(fullscreen=fullscreen, window=window)
# TODO: Make schema for microscope state
return jsonify(microscope.state)
return microscope.state
@ThingAction
@ -176,4 +176,4 @@ class GPUPreviewStopAPI(View):
microscope = find_component("org.openflexure.microscope")
microscope.camera.stop_preview()
# TODO: Make schema for microscope state
return jsonify(microscope.state)
return microscope.state

View file

@ -6,7 +6,7 @@ from labthings.server import fields
from openflexure_microscope.utilities import axes_to_array, filter_dict
from flask import Blueprint, jsonify, request
from flask import Blueprint, request
import logging
@ -53,7 +53,7 @@ class MoveStageAPI(View):
logging.warning("Unable to move. No stage found.")
# TODO: Make schema for microscope state
return jsonify(microscope.state["stage"]["position"])
return microscope.state["stage"]["position"]
@ThingAction
@ -67,4 +67,4 @@ class ZeroStageAPI(View):
microscope.stage.zero_position()
# TODO: Make schema for microscope state
return jsonify(microscope.state["stage"])
return microscope.state["stage"]