Skip to content

Commit

Permalink
Merge pull request #58 from silx-kit/fix-h5grove
Browse files Browse the repository at this point in the history
Make handlers compatible with all h5grove versions
  • Loading branch information
loichuder authored Oct 26, 2021
2 parents 4513703 + c7aa4c4 commit 66b2396
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions jupyterlab_h5web/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66b2396

Please sign in to comment.