progress-table 2.2.8__tar.gz → 2.3.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.
Files changed (22) hide show
  1. {progress_table-2.2.8 → progress_table-2.3.1}/PKG-INFO +12 -2
  2. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table/__init__.py +1 -1
  3. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table/v1/progress_table.py +37 -4
  4. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table.egg-info/PKG-INFO +12 -2
  5. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table.egg-info/PKG-INFO.sync-conflict-20240314-015933-NXTV2IO +0 -0
  6. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table.egg-info/SOURCES.txt +0 -0
  7. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table.egg-info/dependency_links.txt +0 -0
  8. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table.egg-info/requires.txt +0 -0
  9. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table.egg-info/top_level.txt +0 -0
  10. {progress_table-2.2.8 → progress_table-2.3.1}/LICENSE.txt +0 -0
  11. {progress_table-2.2.8 → progress_table-2.3.1}/README.md +0 -0
  12. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table/v0/__init__.py +0 -0
  13. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table/v0/progress_table.py +0 -0
  14. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table/v0/symbols.py +0 -0
  15. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table/v1/__init__.py +0 -0
  16. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table/v1/common.py +0 -0
  17. {progress_table-2.2.8 → progress_table-2.3.1}/progress_table/v1/styles.py +0 -0
  18. {progress_table-2.2.8 → progress_table-2.3.1}/pyproject.toml +0 -0
  19. {progress_table-2.2.8 → progress_table-2.3.1}/setup.cfg +0 -0
  20. {progress_table-2.2.8 → progress_table-2.3.1}/setup.py +0 -0
  21. {progress_table-2.2.8 → progress_table-2.3.1}/tests/test_docs_automated.py +0 -0
  22. {progress_table-2.2.8 → progress_table-2.3.1}/tests/test_examples_automated.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: progress-table
3
- Version: 2.2.8
3
+ Version: 2.3.1
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
@@ -18,6 +18,16 @@ Requires-Python: >=3.7
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE.txt
20
20
  Requires-Dist: colorama
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: license
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
21
31
 
22
32
  > Version 2.X introduces new features and new interactive modes.
23
33
  >
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2022-2024 Szymon Mikler
2
2
 
3
- __version__ = "2.2.8"
3
+ __version__ = "2.3.1"
4
4
 
5
5
  from progress_table.v0.progress_table import ProgressTableV0
6
6
  from progress_table.v1 import styles
@@ -220,7 +220,7 @@ class ProgressTableV1:
220
220
 
221
221
  self.files = (file,) if not isinstance(file, (list, tuple)) else file
222
222
 
223
- assert print_header_every_n_rows > 0, "Reprint header every n rows has to be positive!"
223
+ assert print_header_every_n_rows >= 0, "Value must be non-negative!"
224
224
  self._print_header_on_top = print_header_on_top
225
225
  self._print_header_every_n_rows = print_header_every_n_rows
226
226
  self._previous_header_row_number = 0
@@ -412,7 +412,11 @@ class ProgressTableV1:
412
412
  """End the current row."""
413
413
 
414
414
  # Force header if it wasn't printed for a long enough time
415
- if header is None and len(self._data_rows) - self._previous_header_row_number >= self._print_header_every_n_rows:
415
+ if (
416
+ header is None
417
+ and len(self._data_rows) - self._previous_header_row_number >= self._print_header_every_n_rows
418
+ and self._print_header_every_n_rows > 0
419
+ ):
416
420
  header = True
417
421
  header = header or False
418
422
  split = split or False
@@ -431,7 +435,7 @@ class ProgressTableV1:
431
435
  self._append_new_empty_data_row()
432
436
  # Add decorations and a new row
433
437
  if header:
434
- self._previous_header_row_number = len(self._data_rows)
438
+ self._previous_header_row_number = len(self._data_rows) - 1
435
439
  self._latest_row_decorations.extend(["SPLIT MID", "HEADER", "SPLIT MID"])
436
440
  elif split:
437
441
  self._latest_row_decorations.append("SPLIT MID")
@@ -1013,10 +1017,39 @@ class TableProgressBar:
1013
1017
  return "".join(pbar)
1014
1018
 
1015
1019
  def update(self, n=1):
1020
+ """Update the progress bar steps.
1021
+
1022
+ Args:
1023
+ n: Number of steps to update the progress bar.
1024
+ """
1016
1025
  self._step += n
1017
1026
 
1018
1027
  def reset(self, total=None):
1019
- self._step = total or 0
1028
+ """Reset the progress bar.
1029
+
1030
+ Args:
1031
+ total: Modify the total number of iterations. Optional.
1032
+ """
1033
+ self._step = 0
1034
+
1035
+ if total:
1036
+ self._total = total
1037
+
1038
+ def set_step(self, step):
1039
+ """Overwrite the current step.
1040
+
1041
+ Args:
1042
+ step: New value of the current step.
1043
+ """
1044
+ self._step = step
1045
+
1046
+ def set_total(self, total):
1047
+ """Overwrite the total number of iterations.
1048
+
1049
+ Args:
1050
+ total: New value of the total number of iterations
1051
+ """
1052
+ self._total = total
1020
1053
 
1021
1054
  def __iter__(self):
1022
1055
  try:
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: progress-table
3
- Version: 2.2.8
3
+ Version: 2.3.1
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
@@ -18,6 +18,16 @@ Requires-Python: >=3.7
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE.txt
20
20
  Requires-Dist: colorama
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: license
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
21
31
 
22
32
  > Version 2.X introduces new features and new interactive modes.
23
33
  >
File without changes
File without changes
File without changes