Skip to content

Commit

Permalink
ENH: Support authenticated HTTP(S) access in ORA
Browse files Browse the repository at this point in the history
This uses a newly established helper (from dataladgh-5025).

However, while this is working with `git annex get`, it does not with
`datalad get` -- unclear why.
  • Loading branch information
mih committed Oct 13, 2020
1 parent 4a05696 commit a8b6c77
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions datalad/distributed/ora_remote.py
Expand Up @@ -556,15 +556,8 @@ def get(self, key_path, filename, progress_cb):
# to annexremote.dirhash from within IO classes

url = self.base_url + "/annex/objects/" + str(key_path)
response = requests.get(url, stream=True)

with open(filename, 'wb') as dst_file:
bytes_received = 0
for chunk in response.iter_content(chunk_size=self.buffer_size,
decode_unicode=False):
dst_file.write(chunk)
bytes_received += len(chunk)
progress_cb(bytes_received)
from datalad.utils import download_url
download_url(url, filename, overwrite=True)


def handle_errors(func):
Expand Down

0 comments on commit a8b6c77

Please sign in to comment.