Loading openflexure_microscope/api/default_extensions/__init__.py +11 −1 Original line number Diff line number Diff line import logging import traceback from .autofocus import autofocus_extension_v2 from .scan import scan_extension_v2 from .zip_builder import zip_extension_v2 # "Gracefully" handle cases where picamera cannot be imported (eg test server) try: from .picamera_autocalibrate import lst_extension_v2 except Exception as e: logging.error( f"Exception loading builtin extension picamera_autocalibrate: \n{traceback.format_exc()}" ) No newline at end of file openflexure_microscope/common/flask_labthings/extensions.py +4 −6 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ class BaseExtension: self.actions = [] self.properties = [] self.name = name self._name = name self.description = get_docstring(self) self.version = str(version) Loading @@ -57,9 +57,6 @@ class BaseExtension: view_id = cleaned_rule.replace("/", "_").replace("<", "").replace(">", "") # Create a Python-safe route ID logging.debug(view_id) # Store route information in a dictionary d = {"rule": full_rule, "view": view_class, "kwargs": kwargs} Loading @@ -82,8 +79,8 @@ class BaseExtension: self._meta[key] = val @property def _name(self): return self.name def name(self): return self._name @property def _name_python_safe(self): Loading Loading @@ -111,6 +108,7 @@ def find_instances_in_module(module, class_to_find): for attribute in dir(module): if not attribute.startswith("__"): if isinstance(getattr(module, attribute), class_to_find): logging.debug(f"Found extension {getattr(module, attribute).name}") objs.append(getattr(module, attribute)) return objs Loading Loading
openflexure_microscope/api/default_extensions/__init__.py +11 −1 Original line number Diff line number Diff line import logging import traceback from .autofocus import autofocus_extension_v2 from .scan import scan_extension_v2 from .zip_builder import zip_extension_v2 # "Gracefully" handle cases where picamera cannot be imported (eg test server) try: from .picamera_autocalibrate import lst_extension_v2 except Exception as e: logging.error( f"Exception loading builtin extension picamera_autocalibrate: \n{traceback.format_exc()}" ) No newline at end of file
openflexure_microscope/common/flask_labthings/extensions.py +4 −6 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ class BaseExtension: self.actions = [] self.properties = [] self.name = name self._name = name self.description = get_docstring(self) self.version = str(version) Loading @@ -57,9 +57,6 @@ class BaseExtension: view_id = cleaned_rule.replace("/", "_").replace("<", "").replace(">", "") # Create a Python-safe route ID logging.debug(view_id) # Store route information in a dictionary d = {"rule": full_rule, "view": view_class, "kwargs": kwargs} Loading @@ -82,8 +79,8 @@ class BaseExtension: self._meta[key] = val @property def _name(self): return self.name def name(self): return self._name @property def _name_python_safe(self): Loading Loading @@ -111,6 +108,7 @@ def find_instances_in_module(module, class_to_find): for attribute in dir(module): if not attribute.startswith("__"): if isinstance(getattr(module, attribute), class_to_find): logging.debug(f"Found extension {getattr(module, attribute).name}") objs.append(getattr(module, attribute)) return objs Loading