diff options
| author | Cody Logan <clpo13@gmail.com> | 2021-12-07 15:30:56 -0800 |
|---|---|---|
| committer | Cody Logan <clpo13@gmail.com> | 2021-12-07 15:30:56 -0800 |
| commit | bb0bf8f0c79c31114a615cb201505de3fae15044 (patch) | |
| tree | bd60957b430f4a411b988dad2d3ed53b07b7e8b3 /wikiget/dl.py | |
| parent | 3e57a1902f7bf6884662fb2aca403e13787c2d26 (diff) | |
| download | wikiget-bb0bf8f0c79c31114a615cb201505de3fae15044.tar.gz wikiget-bb0bf8f0c79c31114a615cb201505de3fae15044.zip | |
Standardize on double quotes
Diffstat (limited to 'wikiget/dl.py')
| -rw-r--r-- | wikiget/dl.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/wikiget/dl.py b/wikiget/dl.py index 856d8ca..8f32218 100644 --- a/wikiget/dl.py +++ b/wikiget/dl.py @@ -102,11 +102,12 @@ def download(dl, args): if file.imageinfo != {}: # file exists either locally or at a common repository, # like Wikimedia Commons - file_url = file.imageinfo['url'] - file_size = file.imageinfo['size'] - file_sha1 = file.imageinfo['sha1'] + file_url = file.imageinfo["url"] + file_size = file.imageinfo["size"] + file_sha1 = file.imageinfo["sha1"] - filename_log = f"Downloading '{filename}' ({file_size} bytes) from {site.host}" + filename_log = (f"Downloading '{filename}' ({file_size} bytes) " + f"from {site.host}") if args.output: filename_log += f" to '{dest}'" logging.info(filename_log) @@ -117,7 +118,7 @@ def download(dl, args): "(use -f to ignore)") else: try: - fd = open(dest, 'wb') + fd = open(dest, "wb") except IOError as e: logging.error("File could not be written. " "The following error was encountered:") @@ -130,7 +131,7 @@ def download(dl, args): else: leave_bars = False with tqdm(leave=leave_bars, total=file_size, - unit='B', unit_scale=True, + unit="B", unit_scale=True, unit_divisor=CHUNKSIZE) as progress_bar: with fd: res = site.connection.get(file_url, stream=True) |
