diff options
| author | Cody Logan <cody@lokken.dev> | 2023-10-30 12:22:38 -0700 |
|---|---|---|
| committer | Cody Logan <cody@lokken.dev> | 2023-10-30 12:22:38 -0700 |
| commit | 06183b9947affe71a733d4a324e806863472bdcb (patch) | |
| tree | 0f08e9791518c0678d2058818bc21545e06bf9b8 /src/wikiget/dl.py | |
| parent | 33cab465618c7a82a5d318a18838aab7c9ec9e68 (diff) | |
| download | wikiget-06183b9947affe71a733d4a324e806863472bdcb.tar.gz wikiget-06183b9947affe71a733d4a324e806863472bdcb.zip | |
Code cleanup
Diffstat (limited to 'src/wikiget/dl.py')
| -rw-r--r-- | src/wikiget/dl.py | 11 |
1 files changed, 6 insertions, 5 deletions
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 |
