nercone-modern 1.8.0__tar.gz → 1.9.0__tar.gz
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-1.8.0 → nercone_modern-1.9.0}/PKG-INFO +1 -1
- {nercone_modern-1.8.0 → nercone_modern-1.9.0}/pyproject.toml +1 -1
- {nercone_modern-1.8.0 → nercone_modern-1.9.0}/src/nercone_modern/progressbar.py +4 -2
- {nercone_modern-1.8.0 → nercone_modern-1.9.0}/README.md +0 -0
- {nercone_modern-1.8.0 → nercone_modern-1.9.0}/src/nercone_modern/__init__.py +0 -0
- {nercone_modern-1.8.0 → nercone_modern-1.9.0}/src/nercone_modern/__main__.py +0 -0
- {nercone_modern-1.8.0 → nercone_modern-1.9.0}/src/nercone_modern/color.py +0 -0
- {nercone_modern-1.8.0 → nercone_modern-1.9.0}/src/nercone_modern/logging.py +0 -0
- {nercone_modern-1.8.0 → nercone_modern-1.9.0}/src/nercone_modern/text.py +0 -0
|
@@ -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)
|
|
@@ -145,7 +147,7 @@ class ModernProgressBar:
|
|
|
145
147
|
status = f"{self.box_left}{' ' * total_width}/{' ' * total_width}{self.box_right} "
|
|
146
148
|
else:
|
|
147
149
|
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}"
|
|
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")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|