Loading openflexure_microscope/camera/base.py +1 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,7 @@ class StreamObject(object): def close(self): """Both clear the stream, and delete any associated on-disk data""" log("Closing {}".format(self.id)) self.delete_stream() if not self.keep_on_disk: self.delete_file() Loading openflexure_microscope/camera/pi.py +2 −10 Original line number Diff line number Diff line Loading @@ -100,20 +100,12 @@ class StreamingCamera(BaseCamera): # HANDLE CONTEXT MANAGER AND FILE CLOSING def close(self): """Close method called by BaseCamera __exit__""" # Close all StreamObjects #TODO: Figure out why this is so slow. for capture_list in [self.images, self.videos]: for stream_object in capture_list: stream_object.close() def __enter__(self): log("Entering context for {}.\ Stored files will be cleaned up automatically.".format(self)) return self def __exit__(self, *args): log("Cleaning up {}".format(self)) self.close() self.stop_worker() # RETURNING CAPTURES Loading Loading
openflexure_microscope/camera/base.py +1 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,7 @@ class StreamObject(object): def close(self): """Both clear the stream, and delete any associated on-disk data""" log("Closing {}".format(self.id)) self.delete_stream() if not self.keep_on_disk: self.delete_file() Loading
openflexure_microscope/camera/pi.py +2 −10 Original line number Diff line number Diff line Loading @@ -100,20 +100,12 @@ class StreamingCamera(BaseCamera): # HANDLE CONTEXT MANAGER AND FILE CLOSING def close(self): """Close method called by BaseCamera __exit__""" # Close all StreamObjects #TODO: Figure out why this is so slow. for capture_list in [self.images, self.videos]: for stream_object in capture_list: stream_object.close() def __enter__(self): log("Entering context for {}.\ Stored files will be cleaned up automatically.".format(self)) return self def __exit__(self, *args): log("Cleaning up {}".format(self)) self.close() self.stop_worker() # RETURNING CAPTURES Loading