From ffb4dda6a60e1609f8895009cf95b9178eec0843 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Wed, 7 Nov 2018 10:58:36 +0000 Subject: [PATCH] Added subclass close() method --- openflexure_microscope/camera/base.py | 2 +- openflexure_microscope/camera/pi.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/camera/base.py b/openflexure_microscope/camera/base.py index ebcf7c64..9c15682d 100644 --- a/openflexure_microscope/camera/base.py +++ b/openflexure_microscope/camera/base.py @@ -100,7 +100,7 @@ class BaseCamera(object): self.close() def close(self): - """Handles closing the StreamingCamera""" + """Close the BaseCamera and all attached StreamObjects""" # Close all StreamObjects for capture_list in [self.images, self.videos]: for stream_object in capture_list: diff --git a/openflexure_microscope/camera/pi.py b/openflexure_microscope/camera/pi.py index 4dcee166..9af51457 100644 --- a/openflexure_microscope/camera/pi.py +++ b/openflexure_microscope/camera/pi.py @@ -81,6 +81,9 @@ class StreamingCamera(BaseCamera): """Run any initialisation code when the frame iterator starts.""" pass + def close(self): + """Close the Raspberry Pi StreamingCamera""" + BaseCamera.close(self) # Run BaseCamera close method # HANDLE SETTINGS