nercone-modern 1.8.0__tar.gz → 1.9.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: nercone-modern
3
- Version: 1.8.0
3
+ Version: 1.9.1
4
4
  Summary: Modern CLI Library
5
5
  Author: Nercone
6
6
  Author-email: Nercone <nercone@diamondgotcat.net>
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "nercone-modern"
7
- version = "1.8.0"
7
+ version = "1.9.1"
8
8
  description = "Modern CLI Library"
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  authors = [
@@ -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 = "blue", box_left: str = "[", box_right: 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")
File without changes