Loading docs/source/camera.rst +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ Camera Functionality .. toctree:: :maxdepth: 2 :caption: Contents: picamera.rst basecamera.rst Loading docs/source/pluginmounts.rst 0 → 100644 +17 −0 Original line number Diff line number Diff line Plugin mounts =============== .. automodule:: openflexure_microscope.plugins :members: Default plugins =============== Microscope plugin +++++++++++++++++ .. automodule:: openflexure_microscope.plugins.default.plugin :members: Web API plugin ++++++++++++++ .. automodule:: openflexure_microscope.plugins.default.api :members: docs/source/plugins.rst +24 −8 Original line number Diff line number Diff line Plugin System ============= Plugins ======================================================= .. automodule:: openflexure_microscope.plugins :members: Introduction ------------ Example Plugin -------------- Single-file plugins +++++++++++++++++++ .. automodule:: openflexure_microscope.plugins.default.test_plugin :members: No newline at end of file Package plugins +++++++++++++++ Loading plugins with microscoperc.yaml ++++++++++++++++++++++++++++++++++++++ Microscope plugin structure --------------------------- Adding web API routes --------------------- Mounting and built-ins ---------------------- .. toctree:: :maxdepth: 2 pluginmounts.rst No newline at end of file openflexure_microscope/microscoperc.default.yaml +1 −2 Original line number Diff line number Diff line Loading @@ -23,4 +23,3 @@ picamera_params: # Default plugins plugins: - openflexure_microscope.plugins.default:Plugin No newline at end of file - openflexure_microscope.plugins.test_plugin:FirstPlugin No newline at end of file openflexure_microscope/plugins/default/api.py +12 −2 Original line number Diff line number Diff line Loading @@ -7,14 +7,24 @@ import logging class IdentifyAPI(MicroscopeViewPlugin): """ A simple example API plugin, attached through the main microscope plugin. """ def get(self): """ Method to call when an HTTP GET request is made. """ data = self.microscope.plugin.default.identify() # Call a method from our plugin, using the full route return Response(escape(data)) class HelloWorldAPI(MicroscopeViewPlugin): """ An even simpler example API plugin, which just returns static data without using the microscope. """ def get(self): """ Method to call when an HTTP GET request is made. """ data = self.plugin.hello_world() # Call a method from our plugin, using the MicroscopeViewPlugin.plugin shortcut return Response(data) Loading
docs/source/camera.rst +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ Camera Functionality .. toctree:: :maxdepth: 2 :caption: Contents: picamera.rst basecamera.rst Loading
docs/source/pluginmounts.rst 0 → 100644 +17 −0 Original line number Diff line number Diff line Plugin mounts =============== .. automodule:: openflexure_microscope.plugins :members: Default plugins =============== Microscope plugin +++++++++++++++++ .. automodule:: openflexure_microscope.plugins.default.plugin :members: Web API plugin ++++++++++++++ .. automodule:: openflexure_microscope.plugins.default.api :members:
docs/source/plugins.rst +24 −8 Original line number Diff line number Diff line Plugin System ============= Plugins ======================================================= .. automodule:: openflexure_microscope.plugins :members: Introduction ------------ Example Plugin -------------- Single-file plugins +++++++++++++++++++ .. automodule:: openflexure_microscope.plugins.default.test_plugin :members: No newline at end of file Package plugins +++++++++++++++ Loading plugins with microscoperc.yaml ++++++++++++++++++++++++++++++++++++++ Microscope plugin structure --------------------------- Adding web API routes --------------------- Mounting and built-ins ---------------------- .. toctree:: :maxdepth: 2 pluginmounts.rst No newline at end of file
openflexure_microscope/microscoperc.default.yaml +1 −2 Original line number Diff line number Diff line Loading @@ -23,4 +23,3 @@ picamera_params: # Default plugins plugins: - openflexure_microscope.plugins.default:Plugin No newline at end of file - openflexure_microscope.plugins.test_plugin:FirstPlugin No newline at end of file
openflexure_microscope/plugins/default/api.py +12 −2 Original line number Diff line number Diff line Loading @@ -7,14 +7,24 @@ import logging class IdentifyAPI(MicroscopeViewPlugin): """ A simple example API plugin, attached through the main microscope plugin. """ def get(self): """ Method to call when an HTTP GET request is made. """ data = self.microscope.plugin.default.identify() # Call a method from our plugin, using the full route return Response(escape(data)) class HelloWorldAPI(MicroscopeViewPlugin): """ An even simpler example API plugin, which just returns static data without using the microscope. """ def get(self): """ Method to call when an HTTP GET request is made. """ data = self.plugin.hello_world() # Call a method from our plugin, using the MicroscopeViewPlugin.plugin shortcut return Response(data)