nercone-modern 1.8.0__py3-none-any.whl → 1.9.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nercone_modern/progressbar.py
CHANGED
|
@@ -16,7 +16,7 @@ class ModernProgressBar:
|
|
|
16
16
|
_last_rendered = False
|
|
17
17
|
_lock = threading.RLock()
|
|
18
18
|
|
|
19
|
-
def __init__(self, total: int, process_name: str, spinner_mode: bool = False, primary_color: str = "blue", secondary_color: str = "white", box_color: str = "
|
|
19
|
+
def __init__(self, total: int, process_name: str, spinner_mode: bool = False, primary_color: str = "blue", secondary_color: str = "white", box_color: str = "white", box_left: str = "[", box_right: str = "]", show_bar: bool = True, bar_color: str = "blue"):
|
|
20
20
|
self.total = total
|
|
21
21
|
self.process_name = process_name.strip()
|
|
22
22
|
self.spinner_mode = spinner_mode
|
|
@@ -25,6 +25,8 @@ class ModernProgressBar:
|
|
|
25
25
|
self.box_color = box_color
|
|
26
26
|
self.box_left = box_left
|
|
27
27
|
self.box_right = box_right
|
|
28
|
+
self.show_bar = show_bar
|
|
29
|
+
self.bar_color = bar_color
|
|
28
30
|
self.current = 0
|
|
29
31
|
self.index = len(ModernProgressBar._active_bars)
|
|
30
32
|
ModernProgressBar._active_bars.append(self)
|
|
@@ -144,8 +146,8 @@ class ModernProgressBar:
|
|
|
144
146
|
if self.spinner_mode:
|
|
145
147
|
status = f"{self.box_left}{' ' * total_width}/{' ' * total_width}{self.box_right} "
|
|
146
148
|
else:
|
|
147
|
-
status = f"{self.box_left}{self.current:>{total_width}}/{self.total}{self.box_right} "
|
|
148
|
-
line = f"{ModernColor.color(self.box_color)}{self.box_left}{ModernColor.color('reset')}{ModernColor.color('gray')}{bar}{ModernColor.color('reset')}{ModernColor.color(self.box_color)}{self.box_right}{ModernColor.color('reset')} {ModernColor.color(self.primary_color)}{proc_name}{ModernColor.color('reset')} {percentage_alt if self.spinner_mode else percentage} {status}{ModernColor.color(self.primary_color)}|{ModernColor.color('reset')} {self.message}"
|
|
149
|
+
status = f"{self.box_left}{self.current:>{total_width}}/{self.total:>{total_width}}{self.box_right} "
|
|
150
|
+
line = f"{ModernColor.color(self.bar_color)}{'| ' if self.show_bar else ''}{ModernColor.color('reset')}{ModernColor.color(self.box_color)}{self.box_left}{ModernColor.color('reset')}{ModernColor.color('gray')}{bar}{ModernColor.color('reset')}{ModernColor.color(self.box_color)}{self.box_right}{ModernColor.color('reset')} {ModernColor.color(self.primary_color)}{proc_name}{ModernColor.color('reset')} {percentage_alt if self.spinner_mode else percentage} {status}{ModernColor.color(self.primary_color)}|{ModernColor.color('reset')} {self.message}"
|
|
149
151
|
total_move_up = self.log_lines + (len(ModernProgressBar._active_bars) - self.index)
|
|
150
152
|
if total_move_up > 0:
|
|
151
153
|
sys.stdout.write(f"\033[{total_move_up}A")
|
|
@@ -2,8 +2,8 @@ nercone_modern/__init__.py,sha256=ArF3T8FdWIhwGcL4MfYcHqMse3n5gjuyzbLNlcqRcxs,44
|
|
|
2
2
|
nercone_modern/__main__.py,sha256=tiCwzvs4N0J9_vFoA7eaQqkSIhVcDxUQ9uLPNeSQVWo,2475
|
|
3
3
|
nercone_modern/color.py,sha256=e2P9WXeGosHLCAasdE7IQW29GPZOVDMLsUCsLj6hBkM,1268
|
|
4
4
|
nercone_modern/logging.py,sha256=61ixjR37-ewS1RUwnNZnkNGQEBazhiSJJv5g-rLq834,10158
|
|
5
|
-
nercone_modern/progressbar.py,sha256=
|
|
5
|
+
nercone_modern/progressbar.py,sha256=m3VE3OXgzjevr_G3HoB-NpHNEvowsPuxrPxeuS-859E,8730
|
|
6
6
|
nercone_modern/text.py,sha256=eGxGQOJ3b-783ocLibkG62cOcYD4HLG_3diA52tU8jI,1031
|
|
7
|
-
nercone_modern-1.
|
|
8
|
-
nercone_modern-1.
|
|
9
|
-
nercone_modern-1.
|
|
7
|
+
nercone_modern-1.9.1.dist-info/WHEEL,sha256=w4ZtLaDgMAZW2MMZZwtH8zENekoQYBCeullI-zsXJQk,78
|
|
8
|
+
nercone_modern-1.9.1.dist-info/METADATA,sha256=CtSZ2cE8r-QB0uCmtPUy-UVMze-TQxVPkx8Mx_jB-7c,6127
|
|
9
|
+
nercone_modern-1.9.1.dist-info/RECORD,,
|
|
File without changes
|