Moved plugins up one level and added new view plugins
This commit is contained in:
parent
ac5f26ef6b
commit
bde2e9de2a
7 changed files with 53 additions and 36 deletions
20
openflexure_microscope/plugins/default/api.py
Normal file
20
openflexure_microscope/plugins/default/api.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from openflexure_microscope.api.utilities import parse_payload
|
||||
from openflexure_microscope.api.v1.views import MicroscopeViewPlugin
|
||||
|
||||
from flask import request, Response, escape
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
class IdentifyAPI(MicroscopeViewPlugin):
|
||||
|
||||
def get(self):
|
||||
data = self.microscope.plugin.default.identify() # Call a method from our plugin, using the full route
|
||||
return Response(escape(data))
|
||||
|
||||
|
||||
class HelloWorldAPI(MicroscopeViewPlugin):
|
||||
|
||||
def get(self):
|
||||
data = self.plugin.hello_world() # Call a method from our plugin, using the MicroscopeViewPlugin.plugin shortcut
|
||||
return Response(data)
|
||||
Loading…
Add table
Add a link
Reference in a new issue