progress-table 2.1.0__tar.gz → 2.2.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.
Files changed (22) hide show
  1. {progress-table-2.1.0 → progress-table-2.2.0}/PKG-INFO +1 -1
  2. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table/__init__.py +1 -1
  3. progress-table-2.2.0/progress_table/v1/common.py +47 -0
  4. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table/v1/progress_table.py +62 -77
  5. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table/v1/styles.py +87 -43
  6. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table.egg-info/PKG-INFO +1 -1
  7. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table.egg-info/SOURCES.txt +1 -0
  8. {progress-table-2.1.0 → progress-table-2.2.0}/LICENSE.txt +0 -0
  9. {progress-table-2.1.0 → progress-table-2.2.0}/README.md +0 -0
  10. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table/v0/__init__.py +0 -0
  11. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table/v0/progress_table.py +0 -0
  12. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table/v0/symbols.py +0 -0
  13. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table/v1/__init__.py +0 -0
  14. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table.egg-info/PKG-INFO.sync-conflict-20240314-015933-NXTV2IO +0 -0
  15. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table.egg-info/dependency_links.txt +0 -0
  16. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table.egg-info/requires.txt +0 -0
  17. {progress-table-2.1.0 → progress-table-2.2.0}/progress_table.egg-info/top_level.txt +0 -0
  18. {progress-table-2.1.0 → progress-table-2.2.0}/pyproject.toml +0 -0
  19. {progress-table-2.1.0 → progress-table-2.2.0}/setup.cfg +0 -0
  20. {progress-table-2.1.0 → progress-table-2.2.0}/setup.py +0 -0
  21. {progress-table-2.1.0 → progress-table-2.2.0}/tests/test_docs_automated.py +0 -0
  22. {progress-table-2.1.0 → progress-table-2.2.0}/tests/test_examples_automated.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: progress-table
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: Display progress as a pretty table in the command line.
5
5
  Home-page: https://github.com/gahaalt/progress-table.git
6
6
  Author: Szymon Mikler
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2022-2024 Szymon Mikler
2
2
 
3
- __version__ = "2.1.0"
3
+ __version__ = "2.2.0"
4
4
 
5
5
  from progress_table.v0.progress_table import ProgressTableV0
6
6
  from progress_table.v1 import styles
@@ -0,0 +1,47 @@
1
+ # Copyright (c) 2022-2024 Szymon Mikler
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union
6
+
7
+ from colorama import Back, Fore, Style
8
+
9
+ ALL_COLOR_NAME = [x for x in dir(Fore) if not x.startswith("__")]
10
+ ALL_STYLE_NAME = [x for x in dir(Style) if not x.startswith("__")]
11
+ ALL_COLOR_STYLE_NAME = ALL_COLOR_NAME + ALL_STYLE_NAME
12
+ ALL_COLOR = [getattr(Fore, x) for x in ALL_COLOR_NAME] + [getattr(Back, x) for x in ALL_COLOR_NAME]
13
+ ALL_STYLE = [getattr(Style, x) for x in ALL_STYLE_NAME]
14
+ ALL_COLOR_STYLE = ALL_COLOR + ALL_STYLE
15
+
16
+ COLORAMA_TRANSLATE = {
17
+ "bold": "bright",
18
+ }
19
+
20
+ NoneType = type(None)
21
+ ColorFormat = Union[str, tuple, list, NoneType]
22
+ ColorFormatTuple = (str, tuple, list, NoneType)
23
+
24
+ CURSOR_UP = "\033[A"
25
+
26
+
27
+ def maybe_convert_to_colorama_str(color: str) -> str:
28
+ # Translation layer to fix unintuitive colorama names
29
+ color = COLORAMA_TRANSLATE.get(color.lower(), color)
30
+
31
+ if isinstance(color, str):
32
+ if hasattr(Fore, color.upper()):
33
+ return getattr(Fore, color.upper())
34
+ if hasattr(Style, color.upper()):
35
+ return getattr(Style, color.upper())
36
+
37
+ assert color in ALL_COLOR_STYLE, f"Color {color!r} incorrect! Available: {' '.join(ALL_COLOR_STYLE_NAME)}"
38
+ return color
39
+
40
+
41
+ def maybe_convert_to_colorama(color: ColorFormat) -> str:
42
+ if color is None or color == "":
43
+ return ""
44
+ if isinstance(color, str):
45
+ color = color.split(" ")
46
+ results = [maybe_convert_to_colorama_str(x) for x in color]
47
+ return "".join(results)
@@ -12,30 +12,13 @@ import sys
12
12
  import time
13
13
  from dataclasses import dataclass
14
14
  from threading import Thread
15
- from typing import Any, Callable, Iterable, Sized, Type, Union
15
+ from typing import Any, Callable, Iterable, Sized, Type
16
16
 
17
- from colorama import Back, Fore, Style
17
+ from colorama import Style
18
18
 
19
- from . import styles
20
-
21
- ALL_COLOR_NAME = [x for x in dir(Fore) if not x.startswith("__")]
22
- ALL_STYLE_NAME = [x for x in dir(Style) if not x.startswith("__")]
23
- ALL_COLOR_STYLE_NAME = ALL_COLOR_NAME + ALL_STYLE_NAME
24
-
25
- ALL_COLOR = [getattr(Fore, x) for x in ALL_COLOR_NAME] + [getattr(Back, x) for x in ALL_COLOR_NAME]
26
- ALL_STYLE = [getattr(Style, x) for x in ALL_STYLE_NAME]
27
- ALL_COLOR_STYLE = ALL_COLOR + ALL_STYLE
28
-
29
- COLORAMA_TRANSLATE = {
30
- "bold": "bright",
31
- }
32
-
33
- NoneType = type(None)
34
- ColorFormat = Union[str, tuple, list, NoneType]
35
- ColorFormatTuple = (str, tuple, list, NoneType)
36
-
37
- EPS = 1e-9
38
- CURSOR_UP = "\033[A"
19
+ from progress_table.v1 import styles
20
+ from progress_table.v1.common import CURSOR_UP, ColorFormat, ColorFormatTuple, maybe_convert_to_colorama
21
+ from progress_table.v1.styles import parse_pbar_style
39
22
 
40
23
  # Flags that indicate if the warning was already triggered
41
24
  WARNED_PBAR_HIDDEN = False
@@ -91,29 +74,6 @@ def get_aggregate_fn(aggregate: None | str | Callable):
91
74
  raise ValueError(f"Unknown aggregate type: {type(aggregate)}")
92
75
 
93
76
 
94
- def maybe_convert_to_colorama_str(color: str) -> str:
95
- # Translation layer to fix unintuitive colorama names
96
- color = COLORAMA_TRANSLATE.get(color.lower(), color)
97
-
98
- if isinstance(color, str):
99
- if hasattr(Fore, color.upper()):
100
- return getattr(Fore, color.upper())
101
- if hasattr(Style, color.upper()):
102
- return getattr(Style, color.upper())
103
-
104
- assert color in ALL_COLOR_STYLE, f"Color {color!r} incorrect! Available: {' '.join(ALL_COLOR_STYLE_NAME)}"
105
- return color
106
-
107
-
108
- def maybe_convert_to_colorama(color: ColorFormat) -> str:
109
- if color is None or color == "":
110
- return ""
111
- if isinstance(color, str):
112
- color = color.split(" ")
113
- results = [maybe_convert_to_colorama_str(x) for x in color]
114
- return "".join(results)
115
-
116
-
117
77
  def get_default_format_func(decimal_places):
118
78
  def fmt(x) -> str:
119
79
  if isinstance(x, int):
@@ -158,14 +118,12 @@ class ProgressTableV1:
158
118
  pbar_show_percents: bool = False,
159
119
  pbar_show_eta: bool = False,
160
120
  pbar_embedded: bool = True,
161
- pbar_color_filled: ColorFormat = None,
162
- pbar_color_empty: ColorFormat = None,
121
+ pbar_style: str | Type[styles.PbarStyleBase] = "square",
122
+ pbar_style_embed: str | Type[styles.PbarStyleBase] = "embed",
163
123
  print_header_on_top: bool = True,
164
124
  print_header_every_n_rows: int = 30,
165
125
  custom_cell_format: Callable[[Any], str] | None = None,
166
126
  table_style: str | Type[styles.TableStyleBase] = "round",
167
- pbar_style: str | Type[styles.PbarStyleBase] = "normal",
168
- pbar_style_embed: str | Type[styles.PbarStyleBase] = "embed",
169
127
  file=None,
170
128
  # Deprecated arguments
171
129
  custom_format: None = None,
@@ -217,8 +175,6 @@ class ProgressTableV1:
217
175
  Embedded version is more subtle, but does not prevent the current row from being displayed.
218
176
  If False, the progress bar covers the current row, preventing the user from seeing values
219
177
  that are being updated until the progress bar finishes. The default is True.
220
- pbar_color_filled: Default color of the filled part of the progress bars.
221
- pbar_color_empty: Default color of the empty part of the progress bars.
222
178
  print_header_every_n_rows: 30 by default. When table has a lot of rows, it can be useful to remind what the header is.
223
179
  If True, hedaer will be displayed periodically after the selected number of rows. 0 to supress.
224
180
  custom_cell_format: A function that defines how to get str value to display from a cell content.
@@ -238,15 +194,14 @@ class ProgressTableV1:
238
194
  if print_row_on_update is not None:
239
195
  logging.warning("Argument `print_row_on_update` is deprecated. Specify `interactive` instead!")
240
196
 
241
- self.table_style = styles.figure_table_style(table_style)
242
- self.pbar_style = styles.figure_pbar_style(pbar_style)
243
- self.pbar_style_embed = styles.figure_pbar_style(pbar_style_embed)
197
+ self.table_style = styles.parse_table_style(table_style)
198
+
199
+ self.pbar_style = styles.parse_pbar_style(pbar_style)
200
+ self.pbar_style_embed = styles.parse_pbar_style(pbar_style_embed)
244
201
 
245
202
  assert isinstance(default_row_color, ColorFormatTuple), "Row color has to be a color format!" # type: ignore
246
203
  assert isinstance(default_column_color, ColorFormatTuple), "Column color has to be a color format!" # type: ignore
247
204
  assert isinstance(default_header_color, ColorFormatTuple), "Header color has to be a color format!" # type: ignore
248
- assert isinstance(pbar_color_filled, ColorFormatTuple)
249
- assert isinstance(pbar_color_empty, ColorFormatTuple)
250
205
 
251
206
  # Default values for column and
252
207
  self.column_width = default_column_width
@@ -290,8 +245,6 @@ class ProgressTableV1:
290
245
  self.pbar_show_percents: bool = pbar_show_percents
291
246
  self.pbar_show_eta: bool = pbar_show_eta
292
247
  self.pbar_embedded: bool = pbar_embedded
293
- self.pbar_color_filled = pbar_color_filled
294
- self.pbar_color_empty = pbar_color_empty
295
248
 
296
249
  self.refresh_rate: int = refresh_rate
297
250
 
@@ -813,8 +766,6 @@ class ProgressTableV1:
813
766
  *range_args,
814
767
  position=None,
815
768
  static=False,
816
- color_filled="",
817
- color_empty="",
818
769
  total=None,
819
770
  refresh_rate=None,
820
771
  description="",
@@ -822,6 +773,10 @@ class ProgressTableV1:
822
773
  show_progress=None,
823
774
  show_percents=None,
824
775
  show_eta=None,
776
+ style=None,
777
+ style_embed=None,
778
+ color=None,
779
+ color_empty=None,
825
780
  ):
826
781
  """Create iterable progress bar object.
827
782
 
@@ -831,8 +786,6 @@ class ProgressTableV1:
831
786
  position: Level of the progress bar. If not provided, it will be set automatically.
832
787
  static: If True, the progress bar will stick to the row with index given by position.
833
788
  If False, the position will be interpreted as the offset from the last row.
834
- color_filled: Color of the filled part of the progress bar.
835
- color_empty: Color of the empty part of the progress bar.
836
789
  total: Total number of iterations. If not provided, it will be calculated from the length of the iterable.
837
790
  refresh_rate: The maximal number of times per second the progress bar will be refreshed.
838
791
  description: Custom description of the progress bar that will be shown as prefix.
@@ -840,6 +793,10 @@ class ProgressTableV1:
840
793
  show_progress: If True, the progress will be displayed.
841
794
  show_percents: If True, the percentage of the progress will be displayed.
842
795
  show_eta: If True, the estimated time of finishing will be displayed.
796
+ style: Style of the progress bar. If None, the default style will be used.
797
+ style_embed: Style of the embedded progress bar. If None, the default style will be used.
798
+ color: Color of the progress bar. This overrides the default color.
799
+ color_empty: Color of the empty progress bar. This overrides the default color.
843
800
  """
844
801
  if isinstance(iterable, int):
845
802
  iterable = range(iterable, *range_args)
@@ -857,14 +814,19 @@ class ProgressTableV1:
857
814
 
858
815
  total = total if total is not None else (len(iterable) if isinstance(iterable, Sized) else 0)
859
816
 
817
+ style = parse_pbar_style(style) if style else self.pbar_style
818
+ style_embed = parse_pbar_style(style_embed) if style_embed else self.pbar_style_embed
819
+
860
820
  pbar = TableProgressBar(
861
821
  iterable=iterable,
862
822
  table=self,
863
823
  total=total,
824
+ style=style,
825
+ style_embed=style_embed,
826
+ color=color,
827
+ color_empty=color_empty,
864
828
  position=position,
865
829
  static=static,
866
- color_filled=color_filled or self.pbar_color_filled,
867
- color_empty=color_empty or self.pbar_color_empty,
868
830
  description=description,
869
831
  show_throughput=show_throughput if show_throughput is not None else self.pbar_show_throughput,
870
832
  show_progress=show_progress if show_progress is not None else self.pbar_show_progress,
@@ -886,7 +848,9 @@ class TableProgressBar:
886
848
  *,
887
849
  table,
888
850
  total,
889
- color_filled,
851
+ style,
852
+ style_embed,
853
+ color,
890
854
  color_empty,
891
855
  position,
892
856
  static,
@@ -903,11 +867,21 @@ class TableProgressBar:
903
867
  self._creation_time: float = time.perf_counter()
904
868
  self._last_refresh_time: float = -float("inf")
905
869
 
870
+ self.style = style
871
+ self.style_embed = style_embed
872
+
873
+ # Modyfing styles
874
+ if color:
875
+ color = maybe_convert_to_colorama(color)
876
+ self.style.color = color
877
+ self.style_embed.color = color
878
+ if color_empty:
879
+ color_empty = maybe_convert_to_colorama(color_empty)
880
+ self.style.color_empty = color_empty
881
+ self.style_embed.color_empty = color_empty
882
+
906
883
  self.position: int = position
907
884
  self.static: bool = static
908
-
909
- self.color_filled: str = maybe_convert_to_colorama(color_filled)
910
- self.color_empty: str = maybe_convert_to_colorama(color_empty)
911
885
  self.table: ProgressTableV1 = table
912
886
  self.description: str = description
913
887
  self.show_throughput: bool = show_throughput
@@ -993,6 +967,7 @@ class TableProgressBar:
993
967
  total = tot_width
994
968
 
995
969
  num_filled = math.ceil(step / total * tot_width)
970
+ frac_missing = step / total * tot_width - num_filled
996
971
  num_empty = tot_width - num_filled
997
972
 
998
973
  if embed_str is not None:
@@ -1001,25 +976,35 @@ class TableProgressBar:
1001
976
 
1002
977
  filled_part = row_str[:num_filled]
1003
978
  if len(filled_part) > 0 and filled_part[-1] == " ":
1004
- filled_part = filled_part[:-1] + self.table.pbar_style_embed.head
1005
- filled_part = filled_part.replace(" ", self.table.pbar_style_embed.filled)
979
+ head = self.style_embed.head
980
+ if isinstance(head, (tuple, list)):
981
+ head = head[round(frac_missing * len(head))]
982
+ filled_part = filled_part[:-1] + head
983
+ filled_part = filled_part.replace(" ", self.style_embed.filled)
1006
984
  empty_part = row_str[num_filled:-1]
985
+ color_filled = self.style_embed.color
986
+ color_empty = self.style_embed.color_empty
1007
987
  else:
1008
- filled_part = self.table.pbar_style.filled * num_filled
988
+ filled_part = self.style.filled * num_filled
1009
989
  if len(filled_part) > 0:
1010
- filled_part = filled_part[:-1] + self.table.pbar_style.head
1011
- empty_part = self.table.pbar_style.empty * num_empty
990
+ head = self.style.head
991
+ if isinstance(head, (tuple, list)):
992
+ head = head[round(frac_missing * len(head))]
993
+ filled_part = filled_part[:-1] + head
994
+ empty_part = self.style.empty * num_empty
995
+ color_filled = self.style.color
996
+ color_empty = self.style.color_empty
1012
997
 
1013
998
  pbar_body = "".join(
1014
999
  [
1015
1000
  self.table.table_style.vertical,
1016
1001
  infobar,
1017
- self.color_filled,
1002
+ color_filled,
1018
1003
  filled_part,
1019
- Style.RESET_ALL if self.color_filled else "",
1020
- self.color_empty,
1004
+ Style.RESET_ALL if color_filled else "",
1005
+ color_empty,
1021
1006
  empty_part,
1022
- Style.RESET_ALL if self.color_empty else "",
1007
+ Style.RESET_ALL if color_empty else "",
1023
1008
  self.table.table_style.vertical,
1024
1009
  ]
1025
1010
  )
@@ -1,28 +1,59 @@
1
1
  # Copyright (c) 2022-2024 Szymon Mikler
2
2
 
3
+ from progress_table.v1.common import ALL_COLOR_NAME, maybe_convert_to_colorama
3
4
 
4
- def figure_pbar_style(pbar_style_name):
5
- if isinstance(pbar_style_name, str):
6
- pbar_style_name = pbar_style_name.lower()
5
+
6
+ def contains_word(short, long):
7
+ return any([short == word.strip(" ") for word in long.split(" ")])
8
+
9
+
10
+ def parse_colors_from_description(description):
11
+ color = ""
12
+ color_empty = ""
13
+ for word in description.split():
14
+ for color_name in ALL_COLOR_NAME:
15
+ if color_name.lower() == word.lower():
16
+ if not color:
17
+ color = color_name
18
+ else:
19
+ color_empty = color_name
20
+ description = description.replace(word, "")
21
+ return color, color_empty, description
22
+
23
+
24
+ def parse_pbar_style(description):
25
+ if isinstance(description, str):
7
26
  for obj in available_pbar_styles():
8
- if obj.name == pbar_style_name:
9
- return obj
27
+ if contains_word(obj.name, description):
28
+ description = description.replace(obj.name, "")
29
+ color, color_empty, description = parse_colors_from_description(description)
30
+ is_alt = "alt" in description
31
+ is_clean = "clean" in description
32
+ description = description.replace("alt", "").replace("clean", "").strip(" ")
33
+ if description.strip(" "):
34
+ raise ValueError(f"Name '{description}' is not recognized as a part of progress bar style")
35
+
36
+ return obj(alt=is_alt, clean=is_clean, color=color, color_empty=color_empty)
37
+
10
38
  available_names = ", ".join([obj.name for obj in available_pbar_styles()])
11
- raise ValueError(f"Progress bar style '{pbar_style_name}' not found. Available: {available_names}")
39
+ raise ValueError(f"Progress bar style '{description}' not found. Available: {available_names}")
12
40
  else:
13
- return pbar_style_name
41
+ return description
14
42
 
15
43
 
16
- def figure_table_style(table_style_name):
17
- if isinstance(table_style_name, str):
18
- table_style_name = table_style_name.lower()
44
+ def parse_table_style(description):
45
+ if isinstance(description, str):
19
46
  for obj in available_table_styles():
20
- if obj.name == table_style_name:
21
- return obj
47
+ if contains_word(obj.name, description):
48
+ description = description.replace(obj.name, "").strip(" ")
49
+ if description:
50
+ raise ValueError(f"Name '{description}' is not recognized as a part of table style")
51
+
52
+ return obj()
22
53
  available_names = ", ".join([obj.name for obj in available_table_styles()])
23
- raise ValueError(f"Table style '{table_style_name}' not found. Available: {available_names}")
54
+ raise ValueError(f"Table style '{description}' not found. Available: {available_names}")
24
55
  else:
25
- return table_style_name
56
+ return description
26
57
 
27
58
 
28
59
  def available_table_styles():
@@ -42,16 +73,42 @@ class PbarStyleBase:
42
73
  name: str
43
74
  filled: str
44
75
  empty: str
45
- head: str
46
-
47
-
48
- class PbarStyleNormal(PbarStyleBase):
49
- name = "normal"
76
+ head: str | tuple[str, ...]
77
+ color: str = ""
78
+ color_empty: str = ""
79
+
80
+ def __init__(self, alt=False, clean=False, color=None, color_empty=None):
81
+ if color is not None:
82
+ self.color = maybe_convert_to_colorama(color)
83
+ if color_empty is not None:
84
+ self.color_empty = maybe_convert_to_colorama(color_empty)
85
+ if alt:
86
+ self.empty = self.filled
87
+ if clean:
88
+ self.empty = " "
89
+
90
+
91
+ class PbarStyleSquare(PbarStyleBase):
92
+ name = "square"
50
93
  filled = "■"
51
94
  empty = "□"
52
95
  head = "◩"
53
96
 
54
97
 
98
+ class PbarStyleFull(PbarStyleBase):
99
+ name = "full"
100
+ filled = "█"
101
+ empty = " "
102
+ head = ("▏", "▎", "▍", "▌", "▋", "▊", "▉")
103
+
104
+
105
+ class PbarStyleDots(PbarStyleBase):
106
+ name = "dots"
107
+ filled = "⣿"
108
+ empty = "⣀"
109
+ head = ("⣄", "⣤", "⣦", "⣶", "⣷")
110
+
111
+
55
112
  class PbarStyleShort(PbarStyleBase):
56
113
  name = "short"
57
114
  filled = "▬"
@@ -59,13 +116,6 @@ class PbarStyleShort(PbarStyleBase):
59
116
  head = "▬"
60
117
 
61
118
 
62
- class PbarStyleNormalClean(PbarStyleBase):
63
- name = "normal clean"
64
- filled = "■"
65
- empty = " "
66
- head = "◩"
67
-
68
-
69
119
  class PbarStyleCircle(PbarStyleBase):
70
120
  name = "circle"
71
121
  filled = "●"
@@ -73,13 +123,6 @@ class PbarStyleCircle(PbarStyleBase):
73
123
  head = "◉"
74
124
 
75
125
 
76
- class PbarStyleCircleClean(PbarStyleBase):
77
- name = "circle clean"
78
- filled = "●"
79
- empty = " "
80
- head = "◉"
81
-
82
-
83
126
  class PbarStyleAngled(PbarStyleBase):
84
127
  name = "angled"
85
128
  filled = "▰"
@@ -87,13 +130,6 @@ class PbarStyleAngled(PbarStyleBase):
87
130
  head = "▰"
88
131
 
89
132
 
90
- class PbarStyleAngledClean(PbarStyleBase):
91
- name = "angled clean"
92
- filled = "▰"
93
- empty = " "
94
- head = "▰"
95
-
96
-
97
133
  class PbarStyleEmbed(PbarStyleBase):
98
134
  name = "embed"
99
135
  filled = "ꞏ"
@@ -107,6 +143,14 @@ class PbarStyleRich(PbarStyleBase):
107
143
  empty = " "
108
144
  head = "━"
109
145
 
146
+ def __init__(self, *args, **kwds):
147
+ """Similar to the default progress bar from rich"""
148
+ super().__init__(*args, **kwds)
149
+ if not self.color and not self.color_empty:
150
+ self.color = maybe_convert_to_colorama("red")
151
+ self.color_empty = maybe_convert_to_colorama("black")
152
+ self.empty = self.filled
153
+
110
154
 
111
155
  class PbarStyleNone(PbarStyleBase):
112
156
  name = "hidden"
@@ -136,8 +180,8 @@ class TableStyleBase:
136
180
  no_down: str
137
181
 
138
182
 
139
- class TableStyleNormal(TableStyleBase):
140
- name = "normal"
183
+ class TableStyleModern(TableStyleBase):
184
+ name = "modern"
141
185
  cell_overflow = "…"
142
186
  horizontal = "─"
143
187
  vertical = "│"
@@ -233,7 +277,7 @@ class TableStyleAscii(TableStyleBase):
233
277
 
234
278
 
235
279
  class TableStyleAsciiBare(TableStyleBase):
236
- name = "ascii bare"
280
+ name = "asciib"
237
281
  cell_overflow = "_"
238
282
  horizontal = "-"
239
283
  vertical = " "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: progress-table
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: Display progress as a pretty table in the command line.
5
5
  Home-page: https://github.com/gahaalt/progress-table.git
6
6
  Author: Szymon Mikler
@@ -14,6 +14,7 @@ progress_table/v0/__init__.py
14
14
  progress_table/v0/progress_table.py
15
15
  progress_table/v0/symbols.py
16
16
  progress_table/v1/__init__.py
17
+ progress_table/v1/common.py
17
18
  progress_table/v1/progress_table.py
18
19
  progress_table/v1/styles.py
19
20
  tests/test_docs_automated.py
File without changes
File without changes
File without changes