diff --git a/openflexure_microscope/api/utilities/gui.py b/openflexure_microscope/api/utilities/gui.py index e2187ba5..dcdfe79e 100644 --- a/openflexure_microscope/api/utilities/gui.py +++ b/openflexure_microscope/api/utilities/gui.py @@ -6,7 +6,7 @@ from functools import wraps def clean_rule(rule: str): while rule[0] == "/": rule = rule[1:] - return f"/{rule}" + return f"{rule}" def build_gui_from_dict(gui_description, extension_object): diff --git a/openflexure_microscope/microscope.py b/openflexure_microscope/microscope.py index b1d8d00d..3ed73568 100644 --- a/openflexure_microscope/microscope.py +++ b/openflexure_microscope/microscope.py @@ -88,7 +88,11 @@ class Microscope: stage_type = configuration["stage"].get("type") stage_port = configuration["stage"].get("port") if stage_type in ("SangaBoard", "SangaStage"): - self.stage = SangaStage(port=stage_port) + try: + self.stage = SangaStage(port=stage_port) + except Exception as e: + logging.error(e) + logging.warning("No compatible Sangaboard hardware found.") ### Fallbacks if not self.camera: diff --git a/poetry.lock b/poetry.lock index 46bd50f4..c1f800e8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -265,25 +265,21 @@ i18n = ["Babel (>=0.8)"] [[package]] category = "main" -description = "" +description = "Python implementation of LabThings, based on the Flask microframework" name = "labthings" optional = false -python-versions = "^3.6" +python-versions = ">=3.6,<4.0" version = "0.2.0" [package.dependencies] -Flask = "^1.1.1" -apispec = "^3.2.0" -flask-cors = "^3.0.8" -gevent = "^1.4.0" -gevent-websocket = "^0.10.1" -marshmallow = "^3.4.0" -webargs = "^5.5.3" +Flask = ">=1.1.1,<2.0.0" +apispec = ">=3.2.0,<4.0.0" +flask-cors = ">=3.0.8,<4.0.0" +gevent = ">=1.4.0,<2.0.0" +gevent-websocket = ">=0.10.1,<0.11.0" +marshmallow = ">=3.4.0,<4.0.0" +webargs = ">=5.5.3,<6.0.0" -[package.source] -reference = "2abec0a200e3dbeb8afc8549342328be2357578e" -type = "git" -url = "https://github.com/labthings/python-labthings.git" [[package]] category = "dev" description = "A fast and thorough lazy object proxy." @@ -359,6 +355,7 @@ test = ["coverage", "pytest", "mock", "pillow", "numpy"] reference = "79177fa7f28d6d5c6eab5ba814b420b1785b6b24" type = "git" url = "https://github.com/rwb27/picamera.git" + [[package]] category = "main" description = "Python Imaging Library (Fork)" @@ -700,7 +697,7 @@ version = "1.11.2" rpi = ["picamera", "RPi.GPIO"] [metadata] -content-hash = "4058356cd5db8d9653dd5f7204d691ca07a108936b76136d7332d6eba83029b6" +content-hash = "3a3a3bd4ffd7e0fe4c4c418a1b191c33afd375e6f06bb298189fd84ff75ee4cc" python-versions = "^3.6" [metadata.files] @@ -863,7 +860,10 @@ jinja2 = [ {file = "Jinja2-2.11.1-py2.py3-none-any.whl", hash = "sha256:b0eaf100007721b5c16c1fc1eecb87409464edc10469ddc9a22a27a99123be49"}, {file = "Jinja2-2.11.1.tar.gz", hash = "sha256:93187ffbc7808079673ef52771baa950426fd664d3aad1d0fa3e95644360e250"}, ] -labthings = [] +labthings = [ + {file = "labthings-0.2.0-py3-none-any.whl", hash = "sha256:e2235c0db45c7134403bd78b2aa55ae5aa1bfee677735c9674f52bfcb605e998"}, + {file = "labthings-0.2.0.tar.gz", hash = "sha256:f77391bbb02676ac7c28de59c425c4dc8d6de63031f2a2db8bffd26bc691cb5e"}, +] lazy-object-proxy = [ {file = "lazy-object-proxy-1.4.3.tar.gz", hash = "sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0"}, {file = "lazy_object_proxy-1.4.3-cp27-cp27m-macosx_10_13_x86_64.whl", hash = "sha256:a2238e9d1bb71a56cd710611a1614d1194dc10a175c1e08d75e1a7bcc250d442"}, @@ -915,6 +915,11 @@ markupsafe = [ {file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6"}, {file = "MarkupSafe-1.1.1-cp37-cp37m-win32.whl", hash = "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2"}, {file = "MarkupSafe-1.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-win32.whl", hash = "sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be"}, {file = "MarkupSafe-1.1.1.tar.gz", hash = "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"}, ] marshmallow = [ diff --git a/pyproject.toml b/pyproject.toml index 098a9c85..975b03bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,9 +33,9 @@ picamera = { git = "https://github.com/rwb27/picamera.git", branch = "master", o "RPi.GPIO" = { version = "^0.6.5", optional = true } pyserial = "^3.4" # Used for sangaboard (basic_serial_instrument) until we move to sangaboard pip library -labthings = { git = "https://github.com/labthings/python-labthings.git", branch = "sockets-testing"} # TODO: Pin to a fixed version before 2.0.0 stable python-dateutil = "^2.8" psutil = "^5.6.7" # Autostorage extension +labthings = "0.2.0" [tool.poetry.extras] rpi = ["picamera", "RPi.GPIO"]