diff options
author | mattprost <matt.prost@ni.com> | 2022-04-29 14:13:15 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-06-10 13:24:04 -0500 |
commit | 3dca991bf74ae08cb8b13e12668eff77d14de601 (patch) | |
tree | 34cb506bf7ae0d668ece61463ce9685394ee97ed | |
parent | 9fb6b67f29d479da2c78814e8e3c90b0a192b508 (diff) | |
download | uhd-3dca991bf74ae08cb8b13e12668eff77d14de601.tar.gz uhd-3dca991bf74ae08cb8b13e12668eff77d14de601.tar.bz2 uhd-3dca991bf74ae08cb8b13e12668eff77d14de601.zip |
utils: uhd_images_downloader: Increase default image download size limit
Prompt users for download confirmation of files larger than 1 GiB
instead of 100 MiB. Improve messaging to make this process less
concerning for users. The defined limit is only for the user's
convenience. A 1 GiB limit should allow users to download most uhd
images and related files without being prompted.
Signed-off-by: mattprost <matt.prost@ni.com>
-rw-r--r-- | host/utils/uhd_images_downloader.py.in | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/host/utils/uhd_images_downloader.py.in b/host/utils/uhd_images_downloader.py.in index b45470650..394094b8c 100644 --- a/host/utils/uhd_images_downloader.py.in +++ b/host/utils/uhd_images_downloader.py.in @@ -69,7 +69,7 @@ _DEFAULT_BASE_URL = "https://files.ettus.com/binaries/cache/" _INVENTORY_FILENAME = "inventory.json" _CONTACT = "support@ettus.com" _DEFAULT_BUFFER_SIZE = 8192 -_DEFAULT_DOWNLOAD_LIMIT = 100 * 1024 * 1024 # Bytes +_DEFAULT_DOWNLOAD_LIMIT = 1024 * 1024 * 1024 # Bytes _ARCHIVE_DEFAULT_TYPE = "zip" _UHD_VERSION = "@UHD_VERSION@" _LOG_LEVELS = { @@ -398,14 +398,13 @@ def download( base_filename = os.path.basename(filename) if filesize > download_limit: if not ask_permission( - "The file size for {} ({:.1f} MiB) exceeds the " - "download limit ({:.1f} MiB). Continue downloading?".format( - base_filename, filesize/1024**2, download_limit/1024**2)): + "{} is a large file ({:.1f} GiB). Proceed with download?".format( + base_filename, filesize/1024**3)): return 0, 0, "" if filesize == -1: if not ask_permission( "The file size for {} could not be determined. " - "Continue downloading?".format(base_filename)): + "Proceed with download?".format(base_filename)): return 0, 0, "" filesize_dl = 0 if print_progress and not sys.stdout.isatty(): |