Skip to content

Commit

Permalink
refactor: lint fix following rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunato committed Aug 25, 2023
1 parent bafaf91 commit b6cb78b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions eodag/plugins/download/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,7 @@ def download_request(product, auth, progress_callback, wait, timeout, **kwargs):
os.makedirs(new_fs_path)
shutil.move(fs_path, new_fs_path)
# WARNING: A strong assumption is made here: there is only one file in the directory
file_path = os.path.join(
new_fs_path, os.listdir(new_fs_path)[0]
)
file_path = os.path.join(new_fs_path, os.listdir(new_fs_path)[0])
new_file_path = file_path[: file_path.index(".zip")]
shutil.move(file_path, new_file_path)
else:
Expand All @@ -438,9 +436,7 @@ def download_request(product, auth, progress_callback, wait, timeout, **kwargs):
return new_fs_path

# Check that the downloaded file is not a lone file and must not be placed in a directory
if os.path.isfile(fs_path) and getattr(
self.config, "outputs_in_folder", False
):
if os.path.isfile(fs_path) and getattr(self.config, "outputs_in_folder", False):
new_fs_path = os.path.join(
os.path.dirname(fs_path),
sanitize(product.properties["title"]),
Expand Down

0 comments on commit b6cb78b

Please sign in to comment.