Moved API views up a level
This commit is contained in:
parent
e76dee2383
commit
bb9bb77536
14 changed files with 15 additions and 16 deletions
28
openflexure_microscope/api/views.py
Normal file
28
openflexure_microscope/api/views.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
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