diff options
author | davidovski <david@davidovski.xyz> | 2022-01-19 00:02:08 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-01-19 00:02:08 +0000 |
commit | be11529ff79011f370ce2969dfa145dac81fbee3 (patch) | |
tree | c6680b9e49bb3efa550354517c9758069d3d5bb4 /src/util.py | |
parent | 4d61440c07613661a569a76ba54d0c7d27de1efe (diff) |
added horizontal wavey bars
Diffstat (limited to 'src/util.py')
-rw-r--r-- | src/util.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/util.py b/src/util.py index 5ce93a9..928cb03 100644 --- a/src/util.py +++ b/src/util.py @@ -28,10 +28,13 @@ def is_root(): return os.environ.get("SUDO_UID") or os.geteuid() == 0 +def get_area(): + columns, rows = shutil.get_terminal_size((80, 20)) + def loading_bar(completed, total, text, unit="", color=DEFAULT_BAR_COLOR, reset=DEFAULT_BAR_COLOR_RESET): - columns, rows = shutil.get_terminal_size((80, 20)) + columns, rows = get_area() count = f"[{completed}{unit}/{total}{unit}]" @@ -44,7 +47,7 @@ def loading_bar(completed, total, text, print(color + info, end="\r") def fill_line(text, color, end="\n"): - columns, rows = shutil.get_terminal_size((80, 20)) + columns, rows = get_area() spaces = columns - (len(text)) print(color + text + "".join([" " for i in range(spaces)]), end=end) |