move the progress bar to the bottom

This commit is contained in:
Paul Gauthier 2023-06-27 14:58:15 -07:00
parent 9556313819
commit 8999c3fd97

View file

@ -69,12 +69,12 @@ def diff_partial_update(lines_orig, lines_updated, final=False, fname=None):
else:
pct = 50
bar = create_progress_bar(pct)
bar = f"! {last_non_deleted:3d} / {num_orig_lines:3d} lines [{bar}] {pct:3.0f}%\n\n"
bar = f" {last_non_deleted:3d} / {num_orig_lines:3d} lines [{bar}] {pct:3.0f}%\n"
lines_orig = lines_orig[:last_non_deleted]
if not final:
lines_updated = lines_updated[:-1] + ["...\n"]
lines_updated = lines_updated[:-1] + [bar]
diff = difflib.unified_diff(lines_orig, lines_updated, n=5)
@ -93,10 +93,10 @@ def diff_partial_update(lines_orig, lines_updated, final=False, fname=None):
if fname:
show += f"--- {fname} original\n"
show += f"+++ {fname} updated\n"
if not final:
show += bar
show += diff + f"{backticks}\n\n"
show += diff
show += f"{backticks}\n\n"
# print(diff)