Skip to content

Commit

Permalink
Return local filename after download
Browse files Browse the repository at this point in the history
  • Loading branch information
yannforget committed Nov 27, 2018
1 parent 013eeef commit eeeb7ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion landsatxplore/earthexplorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def _download(self, url, output_dir, file_size, chunk_size=1024):
if chunk:
f.write(chunk)
pbar.update(chunk_size)
return local_filename

def download(self, scene_id, output_dir):
"""Download a Landsat scene given its identifier and an output
Expand All @@ -97,4 +98,5 @@ def download(self, scene_id, output_dir):
if is_product_id(scene_id):
scene_id = self.api.lookup(dataset, [scene_id], inverse=True)[0]
url = EE_DOWNLOAD_URL.format(folder=EE_FOLDER[dataset], sid=scene_id)
self._download(url, output_dir, file_size=SIZES[dataset])
filename = self._download(url, output_dir, file_size=SIZES[dataset])
return filename
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='landsatxplore',
version='0.0.4',
version='0.0.5',
description='Search and download Landsat scenes from EarthExplorer.',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit eeeb7ac

Please sign in to comment.