From 3dca991bf74ae08cb8b13e12668eff77d14de601 Mon Sep 17 00:00:00 2001 From: mattprost Date: Fri, 29 Apr 2022 14:13:15 -0500 Subject: 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 --- host/utils/uhd_images_downloader.py.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'host/utils/uhd_images_downloader.py.in') 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(): -- cgit v1.2.3