Moved microscoperc.yaml to microscope_settings.yaml
This commit is contained in:
parent
1fe8ea18d8
commit
9fc4dfc628
4 changed files with 7 additions and 7 deletions
|
|
@ -11,13 +11,13 @@ Microscope RC file
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
Microscope configuration is made persistent via a microscope runtime-config (RC) file. By default, this
|
Microscope configuration is made persistent via a microscope runtime-config (RC) file. By default, this
|
||||||
file exists at ``~/.openflexure/microscoperc.yaml``, and contains basic parameters to set up the microscope.
|
file exists at ``~/.openflexure/microscope_settings.yaml``, and contains basic parameters to set up the microscope.
|
||||||
|
|
||||||
Additionally, by default, configurations for specific pieces of hardware (i.e. the Pi camera) are located
|
Additionally, by default, configurations for specific pieces of hardware (i.e. the Pi camera) are located
|
||||||
in separate "auxillary" config files, and are linked together by adding the config file's path to your main
|
in separate "auxillary" config files, and are linked together by adding the config file's path to your main
|
||||||
microscope RC file. This is set up by default, as shown below:
|
microscope RC file. This is set up by default, as shown below:
|
||||||
|
|
||||||
Default microscoperc.yaml
|
Default microscope_settings.yaml
|
||||||
+++++++++++++++++++++++++
|
+++++++++++++++++++++++++
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@ Generally, for adding anything other than very simple functionality, plugins sho
|
||||||
|
|
||||||
The main restriction is that the plugin package must be importable using an absolute import from within the Python environment being used to load your microscope.
|
The main restriction is that the plugin package must be importable using an absolute import from within the Python environment being used to load your microscope.
|
||||||
|
|
||||||
Loading plugins with microscoperc.yaml
|
Loading plugins with microscope_settings.yaml
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
Both types of plugin are loaded by specifying the plugin class in your :ref:`MicroscopeRC`. In the case of a single-file plugin, specify the path to the plugin file, followed by the name of your :py:class:`openflexure_microscope.plugins.MicroscopePlugin` child class, separated by a colon. For packaged plugins, specify the absolute module name in place of the path.
|
Both types of plugin are loaded by specifying the plugin class in your :ref:`MicroscopeRC`. In the case of a single-file plugin, specify the path to the plugin file, followed by the name of your :py:class:`openflexure_microscope.plugins.MicroscopePlugin` child class, separated by a colon. For packaged plugins, specify the absolute module name in place of the path.
|
||||||
|
|
||||||
For example, the plugins section of your microscoperc.yaml file may look like:
|
For example, the plugins section of your microscope_settings.yaml file may look like:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,10 @@ from collections import abc
|
||||||
# HANDLE THE DEFAULT CONFIGURATION FILE
|
# HANDLE THE DEFAULT CONFIGURATION FILE
|
||||||
|
|
||||||
HERE = os.path.abspath(os.path.dirname(__file__))
|
HERE = os.path.abspath(os.path.dirname(__file__))
|
||||||
DEFAULT_CONFIG_PATH = os.path.join(HERE, 'microscoperc.default.yaml')
|
DEFAULT_CONFIG_PATH = os.path.join(HERE, 'microscope_settings.default.yaml')
|
||||||
|
|
||||||
USER_CONFIG_DIR = os.path.join(os.path.expanduser("~"), ".openflexure") #: str: Default path of the user-config directory, containing runtime-config and calibration files. Obtained from ``os.path.join(os.path.expanduser("~"), ".openflexure")``.
|
USER_CONFIG_DIR = os.path.join(os.path.expanduser("~"), ".openflexure") #: str: Default path of the user-config directory, containing runtime-config and calibration files. Obtained from ``os.path.join(os.path.expanduser("~"), ".openflexure")``.
|
||||||
USER_CONFIG_FILE = os.path.join(USER_CONFIG_DIR, "microscoperc.yaml") #: str: Default path of the user microscoperc.yaml runtime-config file. Obtained from ``os.path.join(USER_CONFIG_DIR, "microscoperc.yaml")``
|
USER_CONFIG_FILE = os.path.join(USER_CONFIG_DIR, "microscope_settings.yaml") #: str: Default path of the user microscope_settings.yaml runtime-config file. Obtained from ``os.path.join(USER_CONFIG_DIR, "microscope_settings.yaml")``
|
||||||
|
|
||||||
with open(DEFAULT_CONFIG_PATH, 'r') as default_rc:
|
with open(DEFAULT_CONFIG_PATH, 'r') as default_rc:
|
||||||
DEFAULT_CONFIG = default_rc.read()
|
DEFAULT_CONFIG = default_rc.read()
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ class Microscope(object):
|
||||||
if 'plugins' in self.rc.config:
|
if 'plugins' in self.rc.config:
|
||||||
self.attach_plugin_maps(self.rc.config['plugins'])
|
self.attach_plugin_maps(self.rc.config['plugins'])
|
||||||
else:
|
else:
|
||||||
logging.warning("No plugins specified in microscoperc.yaml. Skipping.")
|
logging.warning("No plugins specified in microscope_settings.yaml. Skipping.")
|
||||||
|
|
||||||
def reload_plugins(self):
|
def reload_plugins(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue