Skip to content

Commit

Permalink
Remove another layer of indirection
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Dec 21, 2024
1 parent 2c577f9 commit e5b8c97
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions repo2docker/contentproviders/hydroshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,9 @@ def detect(self, spec, ref=None, extra_args=None):
if parsed.netloc in self.HYDROSHARE_DOMAINS:
return url

def _urlretrieve(self, bag_url):
return urlretrieve(bag_url)

def fetch(self, spec, output_dir, yield_output=False, timeout=120):
"""Fetch and unpack a Hydroshare resource"""
url = spec
print(url)
parts = urlparse(url)
self.resource_id = parts.path.strip("/").rsplit("/", maxsplit=1)[1]

Expand Down Expand Up @@ -98,7 +94,7 @@ def fetch(self, spec, output_dir, yield_output=False, timeout=120):
raise ContentProviderException(msg)
# Bag creation seems to need a small time buffer after it says it's ready.
time.sleep(1)
filehandle, _ = self._urlretrieve(bag_url)
filehandle, _ = urlretrieve(bag_url)
zip_file_object = zipfile.ZipFile(filehandle, "r")
yield "Downloaded, unpacking contents.\n"

Expand Down

0 comments on commit e5b8c97

Please sign in to comment.