Restructured builtin plugins and docstrings

This commit is contained in:
Joel Collins 2018-12-20 15:44:43 +00:00
parent 9ca821c24c
commit 95a3abde7e
7 changed files with 104 additions and 35 deletions

View 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!"