From 49d7e6d78ac7d0572e609eafee5ed8a37211e9cd Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 25 Sep 2021 20:39:08 -0600 Subject: [PATCH] Misc updates --- scripts/wk/kit/tools.py | 6 +++--- scripts/wk/kit/ufd.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/wk/kit/tools.py b/scripts/wk/kit/tools.py index a0466d39..5e888a3f 100644 --- a/scripts/wk/kit/tools.py +++ b/scripts/wk/kit/tools.py @@ -27,10 +27,10 @@ CACHED_DIRS = {} def download_file(out_path, source_url, as_new=False, overwrite=False): """Download a file using requests, returns pathlib.Path.""" out_path = pathlib.Path(out_path).resolve() + download_msg = f'Downloading {out_path.name}...' if as_new: out_path = out_path.with_suffix(f'{out_path.suffix}.new') - cursor_left = '\u001B[14D' - print(f'Downloading...{cursor_left}', end='', flush=True) + print(download_msg, end='', flush=True) # Avoid clobbering if out_path.exists() and not overwrite: @@ -57,7 +57,7 @@ def download_file(out_path, source_url, as_new=False, overwrite=False): _f.write(chunk) # Done - print(f' {cursor_left}', end='', flush=True) + print(f'\r{" "*len(download_msg)}\r', end='', flush=True) return out_path diff --git a/scripts/wk/kit/ufd.py b/scripts/wk/kit/ufd.py index 5b700b6a..e1f7ee7a 100644 --- a/scripts/wk/kit/ufd.py +++ b/scripts/wk/kit/ufd.py @@ -153,7 +153,7 @@ def build_ufd(): ) for s_label, s_path in sources.items(): try_print.run( - message='Copying {}...'.format(s_label), + message=f'Copying {s_label}...', function=copy_source, source=s_path, items=ITEMS[s_label],