Loading openflexure_microscope/plugins/default/test_plugin/__init__.py +2 −34 Original line number Diff line number Diff line from openflexure_microscope.plugins import MicroscopePlugin class FirstPlugin(MicroscopePlugin): """ An example Microscope plugin. """ def run(self): """ Demonstrate access to Microscope.camera, and Microscope.stage """ print("Parent camera:") print(self.camera) print("Parent stage:") print(self.stage) class OtherPlugin(MicroscopePlugin): """ An example of a second Microscope plugin, loaded from the same plugin file. """ def run(self): """ Demonstrate access to Microscope.camera, and Microscope.stage """ print("Stage plugin parent stage:") print(self.stage) PLUGINS = { 'test1': FirstPlugin, 'test2': OtherPlugin, } #: dict: Dictionary describing the plugins. Keys are the names of the plugin's namescape, with a value corresponding to the class of that plugin. No newline at end of file from .plugin import PLUGINS from .api import ENDPOINTS openflexure_microscope/plugins/default/test_plugin/api.py 0 → 100644 +3 −0 Original line number Diff line number Diff line from openflexure_microscope.api.v1.views import MicroscopeView ENDPOINTS = {} openflexure_microscope/plugins/default/test_plugin/plugin.py 0 → 100644 +34 −0 Original line number Diff line number Diff line from openflexure_microscope.plugins import MicroscopePlugin class FirstPlugin(MicroscopePlugin): """ An example Microscope plugin. """ def run(self): """ Demonstrate access to Microscope.camera, and Microscope.stage """ print("Parent camera:") print(self.microscope.camera) print("Parent stage:") print(self.microscope.stage) class OtherPlugin(MicroscopePlugin): """ An example of a second Microscope plugin, loaded from the same plugin file. """ def run(self): """ Demonstrate access to Microscope.camera, and Microscope.stage """ print("Stage plugin parent stage:") print(self.microscope.stage) PLUGINS = { 'test1': FirstPlugin, 'test2': OtherPlugin, } #: dict: Dictionary describing the plugins. Keys are the names of the plugin's namescape, with a value corresponding to the class of that plugin. No newline at end of file Loading
openflexure_microscope/plugins/default/test_plugin/__init__.py +2 −34 Original line number Diff line number Diff line from openflexure_microscope.plugins import MicroscopePlugin class FirstPlugin(MicroscopePlugin): """ An example Microscope plugin. """ def run(self): """ Demonstrate access to Microscope.camera, and Microscope.stage """ print("Parent camera:") print(self.camera) print("Parent stage:") print(self.stage) class OtherPlugin(MicroscopePlugin): """ An example of a second Microscope plugin, loaded from the same plugin file. """ def run(self): """ Demonstrate access to Microscope.camera, and Microscope.stage """ print("Stage plugin parent stage:") print(self.stage) PLUGINS = { 'test1': FirstPlugin, 'test2': OtherPlugin, } #: dict: Dictionary describing the plugins. Keys are the names of the plugin's namescape, with a value corresponding to the class of that plugin. No newline at end of file from .plugin import PLUGINS from .api import ENDPOINTS
openflexure_microscope/plugins/default/test_plugin/api.py 0 → 100644 +3 −0 Original line number Diff line number Diff line from openflexure_microscope.api.v1.views import MicroscopeView ENDPOINTS = {}
openflexure_microscope/plugins/default/test_plugin/plugin.py 0 → 100644 +34 −0 Original line number Diff line number Diff line from openflexure_microscope.plugins import MicroscopePlugin class FirstPlugin(MicroscopePlugin): """ An example Microscope plugin. """ def run(self): """ Demonstrate access to Microscope.camera, and Microscope.stage """ print("Parent camera:") print(self.microscope.camera) print("Parent stage:") print(self.microscope.stage) class OtherPlugin(MicroscopePlugin): """ An example of a second Microscope plugin, loaded from the same plugin file. """ def run(self): """ Demonstrate access to Microscope.camera, and Microscope.stage """ print("Stage plugin parent stage:") print(self.microscope.stage) PLUGINS = { 'test1': FirstPlugin, 'test2': OtherPlugin, } #: dict: Dictionary describing the plugins. Keys are the names of the plugin's namescape, with a value corresponding to the class of that plugin. No newline at end of file