From c7aa4c4f79d6a82d64e09069bb65881f44ab1d75 Mon Sep 17 00:00:00 2001 From: Loic Huder Date: Tue, 26 Oct 2021 16:09:30 +0200 Subject: [PATCH] Make handlers compatible with all h5grove versions --- jupyterlab_h5web/handlers.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/jupyterlab_h5web/handlers.py b/jupyterlab_h5web/handlers.py index f426d38..7dfddd9 100644 --- a/jupyterlab_h5web/handlers.py +++ b/jupyterlab_h5web/handlers.py @@ -20,18 +20,17 @@ def get(self): if file_path is None: raise MissingArgumentError("File argument is required") path = self.get_query_argument("path", None) - format = self.get_query_argument("format", None) + format_arg = self.get_query_argument("format", None) with h5py.File(as_absolute_path(self.base_dir, Path(file_path)), "r") as h5file: content = self.get_content(h5file, path) - encoded_content_chunks, headers = encode(content, format) + chunks, headers = encode(content, format_arg) for key, value in headers.items(): self.set_header(key, value) - for chunk in encoded_content_chunks: - self.write(chunk) - self.finish() + + self.finish(chunks) def get_content(self, h5file, path): raise NotImplementedError