Moved API views up a level
This commit is contained in:
parent
e76dee2383
commit
bb9bb77536
14 changed files with 15 additions and 16 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from openflexure_microscope.api.utilities import gen, JsonResponse
|
||||
from openflexure_microscope.api.v1.views import MicroscopeView
|
||||
from openflexure_microscope.api.views import MicroscopeView
|
||||
|
||||
from flask import Response, Blueprint, jsonify, request
|
||||
import logging
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
from openflexure_microscope.api.v1.views import MicroscopeView
|
||||
|
||||
from flask import Blueprint
|
||||
|
||||
from . import capture, record, preview, function
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
from openflexure_microscope.api.utilities import get_bool, JsonResponse
|
||||
from openflexure_microscope.api.v1.views import MicroscopeView
|
||||
from openflexure_microscope.api.views import MicroscopeView
|
||||
from openflexure_microscope.utilities import filter_dict
|
||||
|
||||
from flask import Response, jsonify, request, abort, url_for, redirect, send_file
|
||||
from flask import jsonify, request, abort, url_for, redirect, send_file
|
||||
|
||||
|
||||
class ListAPI(MicroscopeView):
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from openflexure_microscope.api.v1.views import MicroscopeView
|
||||
from openflexure_microscope.api.views import MicroscopeView
|
||||
from openflexure_microscope.api.utilities import JsonResponse
|
||||
|
||||
from flask import jsonify, request
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from openflexure_microscope.api.utilities import JsonResponse
|
||||
from openflexure_microscope.api.v1.views import MicroscopeView
|
||||
from openflexure_microscope.api.views import MicroscopeView
|
||||
|
||||
from flask import jsonify, request
|
||||
import logging
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from openflexure_microscope.api.v1.views import MicroscopeViewPlugin
|
||||
from openflexure_microscope.api.views import MicroscopeViewPlugin
|
||||
|
||||
from flask import Blueprint, jsonify
|
||||
from openflexure_microscope.api.v1.views import MicroscopeView
|
||||
from openflexure_microscope.api.views import MicroscopeView
|
||||
|
||||
import logging
|
||||
import warnings
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from openflexure_microscope.api.utilities import JsonResponse
|
||||
from openflexure_microscope.api.v1.views import MicroscopeView
|
||||
from openflexure_microscope.api.views import MicroscopeView
|
||||
from openflexure_microscope.utilities import axes_to_array, filter_dict
|
||||
|
||||
from flask import Blueprint, jsonify, request
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from openflexure_microscope.api.v1.views import MethodView
|
||||
from openflexure_microscope.api.views import MethodView
|
||||
from flask import jsonify, abort, Blueprint
|
||||
|
||||
from openflexure_microscope.common import tasks
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
from flask.views import MethodView
|
||||
|
||||
|
||||
class MicroscopeView(MethodView):
|
||||
"""
|
||||
Create a generic MethodView with a globally available
|
||||
microscope object passed as an argument.
|
||||
"""
|
||||
|
||||
def __init__(self, microscope, **kwargs):
|
||||
|
||||
self.microscope = microscope
|
||||
|
||||
MethodView.__init__(self, **kwargs)
|
||||
|
||||
|
||||
class MicroscopeViewPlugin(MicroscopeView):
|
||||
"""
|
||||
Create a generic MethodView with a globally available
|
||||
microscope object passed as an argument, and a plugin
|
||||
reference stored in 'self'. Initially None.
|
||||
"""
|
||||
|
||||
def __init__(self, microscope, plugin=None, **kwargs):
|
||||
|
||||
self.plugin = plugin
|
||||
|
||||
MicroscopeView.__init__(self, microscope=microscope, **kwargs)
|
||||
Loading…
Add table
Add a link
Reference in a new issue