Skip to content

Commit

Permalink
style(hmnfusion): super-linter
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-gricourt committed Oct 30, 2023
1 parent d02c54f commit 24ce1e8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/hmnfusion/download_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class DownloadZenodo(object):

ZENODO_API = "https://zenodo.org/api/"

def __init__(self, id: str, params: Dict[str, str]) -> None:
Expand All @@ -25,11 +24,12 @@ def show_files(self) -> Dict[str, str]:

def download_file(self, url: str, path: str) -> None:
try:
with requests.get(url, stream=True, params=self.params) as r:
self.check_request(request=r)
with open(path, "wb") as f:
for chunk in r.iter_content(chunk_size=8192):
f.write(chunk)
response = requests.get(url, stream=True, params=self.params)
self.check_request(request=response)
with open(path, "wb") as fod:
for chunk in response.iter_content(chunk_size=8192):
fod.write(chunk)
response.close()
except Exception as e:
raise ValueError(str(e))

Expand Down

0 comments on commit 24ce1e8

Please sign in to comment.