From dce59f3b88f0a93b860824a380a60be2219f9438 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Wed, 21 Nov 2018 09:51:04 +0000 Subject: [PATCH] Fixed new download redirect route --- openflexure_microscope/api/v1.py | 4 ++-- openflexure_microscope/camera/capture.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openflexure_microscope/api/v1.py b/openflexure_microscope/api/v1.py index e49a0d2f..670c11d4 100644 --- a/openflexure_microscope/api/v1.py +++ b/openflexure_microscope/api/v1.py @@ -488,7 +488,7 @@ app.add_url_rule( class CaptureDownloadRedirectAPI(MicroscopeView): - def get(self, capture_id, filename): + def get(self, capture_id): """ Redirect to download the capture under it's currently set filename. I.e., `/(capture_id)/download` will @@ -511,7 +511,7 @@ class CaptureDownloadRedirectAPI(MicroscopeView): # Route for shortcut where no filename is specified app.add_url_rule( - uri('/capture//download/'), + uri('/capture//download'), view_func=CaptureDownloadRedirectAPI.as_view('capture_download_redirect', microscope=api_microscope)) diff --git a/openflexure_microscope/camera/capture.py b/openflexure_microscope/camera/capture.py index d9572513..4b671a49 100644 --- a/openflexure_microscope/camera/capture.py +++ b/openflexure_microscope/camera/capture.py @@ -29,6 +29,9 @@ class StreamObject(object): # Store file format self.format = fmt + # Keep on disk after close by default + self.keep_on_disk = keep_on_disk + # Create file name. Default to UUID if not filename: filename = self.id @@ -46,9 +49,6 @@ class StreamObject(object): logging.debug("Target for {} set to 'file'".format(self.id)) self.target = self.file - # Keep on disk after close by default - self.keep_on_disk = keep_on_disk - # Log if created by context manager self.context_manager = False