From 0c156128fcd53b629e8199f8743cdca4dad05f15 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Wed, 30 Jan 2019 12:02:35 +0000 Subject: [PATCH] Minor formatting changes --- openflexure_microscope/microscope.py | 2 +- openflexure_microscope/plugins/example/plugin.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/openflexure_microscope/microscope.py b/openflexure_microscope/microscope.py index 9502a112..ea940336 100644 --- a/openflexure_microscope/microscope.py +++ b/openflexure_microscope/microscope.py @@ -107,7 +107,7 @@ class Microscope(object): logging.info("Attached dummy stage.") # If stage object has a lock if hasattr(self.stage, 'lock'): - logging.info("Attaching {} to composite lock.".format(self.stage.lock)) + logging.info("Attaching lock {} to composite lock.".format(self.stage.lock)) # Add the lock to the microscope composite lock self.lock.locks.append(self.stage.lock) diff --git a/openflexure_microscope/plugins/example/plugin.py b/openflexure_microscope/plugins/example/plugin.py index 9fff76aa..1afebf09 100644 --- a/openflexure_microscope/plugins/example/plugin.py +++ b/openflexure_microscope/plugins/example/plugin.py @@ -50,10 +50,8 @@ class Plugin(MicroscopePlugin): print("Starting a long-running task...") n_array = [] - #print("Acquiring camera and stage locks...") - #with self.microscope.camera.lock, self.microscope.stage.lock: print("Acquiring composite microscope lock...") - with self.microscope.lock: + with self.microscope.camera.lock, self.microscope.stage.lock: for _ in range(t_run): n_array.append(random.random()) time.sleep(1)