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
30
openflexure_microscope/plugins/default/plugin.py
Normal file
30
openflexure_microscope/plugins/default/plugin.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
from openflexure_microscope.plugins import MicroscopePlugin
|
||||
|
||||
from .api import IdentifyAPI, HelloWorldAPI
|
||||
|
||||
|
||||
class Plugin(MicroscopePlugin):
|
||||
"""
|
||||
A set of default plugins
|
||||
"""
|
||||
|
||||
api_views = {
|
||||
'/identify': IdentifyAPI,
|
||||
'/hello': HelloWorldAPI,
|
||||
}
|
||||
|
||||
def identify(self):
|
||||
"""
|
||||
Demonstrate access to Microscope.camera, and Microscope.stage
|
||||
"""
|
||||
|
||||
response = "My parent camera is {}, and my parent stage is {}.".format(self.microscope.camera, self.microscope.stage)
|
||||
print(response)
|
||||
return response
|
||||
|
||||
def hello_world(self):
|
||||
"""
|
||||
Demonstrate passive method
|
||||
"""
|
||||
|
||||
return "Hello world!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue