From 06183b9947affe71a733d4a324e806863472bdcb Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Mon, 30 Oct 2023 12:22:38 -0700 Subject: Code cleanup --- src/wikiget/dl.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/wikiget/dl.py') diff --git a/src/wikiget/dl.py b/src/wikiget/dl.py index 845d136..f210182 100644 --- a/src/wikiget/dl.py +++ b/src/wikiget/dl.py @@ -50,7 +50,7 @@ def batch_download(args: Namespace) -> int: try: dl_list = read_batch_file(args.FILE) except OSError as e: - logger.error(f"File could not be read. {e}") + logger.error(f"File could not be read: {e}") sys.exit(1) # TODO: validate file contents before download process starts @@ -102,15 +102,16 @@ def download(f: File, args: Namespace) -> int: adapter.info(f"{file_url}") if os.path.isfile(dest) and not args.force: - adapter.warning("File already exists, skipping download (use -f to force)") + # TODO: check for this before the download process starts + adapter.warning("File already exists; skipping download (use -f to force)") errors += 1 elif args.dry_run: - adapter.warning("Dry run, so nothing actually downloaded") + adapter.warning("Dry run; download skipped") else: try: fd = open(dest, "wb") except OSError as e: - adapter.error(f"File could not be written. {e}") + adapter.error(f"File could not be written: {e}") errors += 1 return errors # download the file(s) @@ -133,7 +134,7 @@ def download(f: File, args: Namespace) -> int: try: dl_sha1 = verify_hash(dest) except OSError as e: - adapter.error(f"File downloaded but could not be verified. {e}") + adapter.error(f"File downloaded but could not be verified: {e}") errors += 1 return errors -- cgit v1.2.3