Replace already_downloaded_path with existence check
These statements are equivalent, so we exchange them. This will make it
easier to factor the download_dir concerns out of these functions.
@@ -166,10 +166,9 @@ def unpack_http_url(
unpack_file(from_path, location, content_type)
# a download dir is specified; let's copy the archive there
- if download_dir and not already_downloaded_path:
- assert not os.path.exists(
+ if download_dir and not os.path.exists(
os.path.join(download_dir, link.filename)
- )
+ ):
_copy_file(from_path, download_dir, link)
@@ -263,8 +262,9 @@ def unpack_file_url(
unpack_file(from_path, location, content_type)
# a download dir is specified and not already downloaded
- if download_dir and not already_downloaded_path:
- assert not os.path.exists(os.path.join(download_dir, link.filename))
+ if download_dir and not os.path.exists(
+ os.path.join(download_dir, link.filename)
+ ):
_copy_file(from_path, download_dir, link)
