Skip to content

Commit

Permalink
Make handlers compatible with all h5grove versions
Browse files Browse the repository at this point in the history
  • Loading branch information
loichuder committed Oct 26, 2021
1 parent 4513703 commit c7aa4c4
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 c7aa4c4

Please sign in to comment.