Loading openflexure_microscope/api/app.py +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ from flask import ( from flask.views import MethodView from werkzeug.exceptions import default_exceptions from openflexure_microscope.api.utilities import parse_payload, get_from_payload, gen, get_bool, list_routes from openflexure_microscope.api.utilities import list_routes from openflexure_microscope import Microscope, config from openflexure_microscope.camera.pi import StreamingCamera Loading openflexure_microscope/api/v1/blueprints/base.py +1 −1 Original line number Diff line number Diff line from openflexure_microscope.api.utilities import parse_payload, get_from_payload, gen, get_bool from openflexure_microscope.api.utilities import gen from openflexure_microscope.api.v1.views import MicroscopeView from flask import Response, Blueprint, jsonify Loading openflexure_microscope/api/v1/blueprints/camera/capture.py +8 −9 Original line number Diff line number Diff line from openflexure_microscope.api.utilities import parse_payload, get_from_payload, gen, get_bool from openflexure_microscope.api.utilities import gen, get_bool, JsonPayload from openflexure_microscope.api.v1.views import MicroscopeView from flask import Response, Blueprint, jsonify, request, abort, url_for, redirect, send_file Loading Loading @@ -97,14 +97,13 @@ class ListAPI(MicroscopeView): :<header Content-Type: application/json :status 200: capture created """ state = parse_payload(request) logging.info(state) payload = JsonPayload(request) filename = get_from_payload(state, 'filename', default=None) keep_on_disk = bool(get_from_payload(state, 'keep_on_disk', default=True)) use_video_port = bool(get_from_payload(state, 'use_video_port', default=False)) filename = payload.param('filename') keep_on_disk = payload.param('keep_on_disk', default=True, convert=bool) use_video_port = payload.param('use_video_port', default=False, convert=bool) resize = get_from_payload(state, 'size', default=None) resize = payload.param('size', default=None) if resize: if ('width' in resize) and ('height' in resize): resize = (int(resize['width']), int(resize['height'])) # Convert dict to tuple Loading openflexure_microscope/api/v1/blueprints/camera/preview.py +0 −1 Original line number Diff line number Diff line from openflexure_microscope.api.utilities import parse_payload, get_from_payload, gen, get_bool from openflexure_microscope.api.v1.views import MicroscopeView from flask import Response, Blueprint, jsonify, request, abort, url_for, redirect, send_file Loading openflexure_microscope/api/v1/blueprints/plugins.py +0 −1 Original line number Diff line number Diff line from openflexure_microscope.api.utilities import parse_payload, get_from_payload, gen, get_bool from openflexure_microscope.api.v1.views import MicroscopeViewPlugin from flask import Response, Blueprint, jsonify Loading Loading
openflexure_microscope/api/app.py +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ from flask import ( from flask.views import MethodView from werkzeug.exceptions import default_exceptions from openflexure_microscope.api.utilities import parse_payload, get_from_payload, gen, get_bool, list_routes from openflexure_microscope.api.utilities import list_routes from openflexure_microscope import Microscope, config from openflexure_microscope.camera.pi import StreamingCamera Loading
openflexure_microscope/api/v1/blueprints/base.py +1 −1 Original line number Diff line number Diff line from openflexure_microscope.api.utilities import parse_payload, get_from_payload, gen, get_bool from openflexure_microscope.api.utilities import gen from openflexure_microscope.api.v1.views import MicroscopeView from flask import Response, Blueprint, jsonify Loading
openflexure_microscope/api/v1/blueprints/camera/capture.py +8 −9 Original line number Diff line number Diff line from openflexure_microscope.api.utilities import parse_payload, get_from_payload, gen, get_bool from openflexure_microscope.api.utilities import gen, get_bool, JsonPayload from openflexure_microscope.api.v1.views import MicroscopeView from flask import Response, Blueprint, jsonify, request, abort, url_for, redirect, send_file Loading Loading @@ -97,14 +97,13 @@ class ListAPI(MicroscopeView): :<header Content-Type: application/json :status 200: capture created """ state = parse_payload(request) logging.info(state) payload = JsonPayload(request) filename = get_from_payload(state, 'filename', default=None) keep_on_disk = bool(get_from_payload(state, 'keep_on_disk', default=True)) use_video_port = bool(get_from_payload(state, 'use_video_port', default=False)) filename = payload.param('filename') keep_on_disk = payload.param('keep_on_disk', default=True, convert=bool) use_video_port = payload.param('use_video_port', default=False, convert=bool) resize = get_from_payload(state, 'size', default=None) resize = payload.param('size', default=None) if resize: if ('width' in resize) and ('height' in resize): resize = (int(resize['width']), int(resize['height'])) # Convert dict to tuple Loading
openflexure_microscope/api/v1/blueprints/camera/preview.py +0 −1 Original line number Diff line number Diff line from openflexure_microscope.api.utilities import parse_payload, get_from_payload, gen, get_bool from openflexure_microscope.api.v1.views import MicroscopeView from flask import Response, Blueprint, jsonify, request, abort, url_for, redirect, send_file Loading
openflexure_microscope/api/v1/blueprints/plugins.py +0 −1 Original line number Diff line number Diff line from openflexure_microscope.api.utilities import parse_payload, get_from_payload, gen, get_bool from openflexure_microscope.api.v1.views import MicroscopeViewPlugin from flask import Response, Blueprint, jsonify Loading