progressbar2 4.4.2__tar.gz → 4.5.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 (120) hide show
  1. {progressbar2-4.4.2 → progressbar2-4.5.0}/.github/workflows/stale.yml +2 -2
  2. {progressbar2-4.4.2 → progressbar2-4.5.0}/PKG-INFO +1 -9
  3. {progressbar2-4.4.2 → progressbar2-4.5.0}/README.rst +0 -8
  4. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/conf.py +15 -12
  5. {progressbar2-4.4.2 → progressbar2-4.5.0}/examples.py +69 -66
  6. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/__about__.py +6 -6
  7. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/__main__.py +15 -12
  8. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/algorithms.py +6 -6
  9. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/bar.py +124 -110
  10. progressbar2-4.5.0/progressbar/base.py +36 -0
  11. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/env.py +16 -13
  12. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/multi.py +10 -10
  13. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/shortcuts.py +1 -1
  14. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/terminal/base.py +70 -70
  15. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/terminal/colors.py +8 -6
  16. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/terminal/os_specific/posix.py +1 -1
  17. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/terminal/os_specific/windows.py +5 -4
  18. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/terminal/stream.py +8 -4
  19. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/utils.py +21 -16
  20. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/widgets.py +85 -85
  21. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar2.egg-info/PKG-INFO +1 -9
  22. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar2.egg-info/SOURCES.txt +0 -1
  23. {progressbar2-4.4.2 → progressbar2-4.5.0}/pyproject.toml +25 -0
  24. {progressbar2-4.4.2 → progressbar2-4.5.0}/ruff.toml +7 -2
  25. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/conftest.py +7 -4
  26. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/original_examples.py +23 -23
  27. progressbar2-4.5.0/tests/test_algorithms.py +58 -0
  28. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_backwards_compatibility.py +1 -1
  29. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_color.py +103 -92
  30. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_custom_widgets.py +5 -4
  31. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_data.py +3 -2
  32. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_data_transfer_bar.py +2 -2
  33. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_dill_pickle.py +2 -1
  34. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_empty.py +2 -2
  35. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_end.py +5 -4
  36. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_failure.py +28 -27
  37. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_flush.py +2 -2
  38. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_iterators.py +13 -12
  39. progressbar2-4.5.0/tests/test_job_status.py +22 -0
  40. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_large_values.py +2 -2
  41. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_misc.py +1 -1
  42. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_monitor_progress.py +40 -36
  43. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_multibar.py +19 -19
  44. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_progressbar.py +11 -9
  45. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_progressbar_command.py +58 -16
  46. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_samples.py +5 -4
  47. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_speed.py +3 -2
  48. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_stream.py +13 -12
  49. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_terminal.py +18 -18
  50. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_timed.py +15 -15
  51. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_timer.py +4 -3
  52. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_unicode.py +5 -2
  53. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_unknown_length.py +3 -3
  54. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_utils.py +8 -4
  55. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_widgets.py +18 -11
  56. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_windows.py +15 -9
  57. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_with.py +3 -3
  58. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/test_wrappingio.py +3 -2
  59. {progressbar2-4.4.2 → progressbar2-4.5.0}/tox.ini +13 -16
  60. progressbar2-4.4.2/docs/progressbar.terminal.os_specific.rst +0 -16
  61. progressbar2-4.4.2/progressbar/base.py +0 -31
  62. progressbar2-4.4.2/tests/test_algorithms.py +0 -47
  63. progressbar2-4.4.2/tests/test_job_status.py +0 -19
  64. {progressbar2-4.4.2 → progressbar2-4.5.0}/.github/FUNDING.yml +0 -0
  65. {progressbar2-4.4.2 → progressbar2-4.5.0}/.github/ci-reporter.yml +0 -0
  66. {progressbar2-4.4.2 → progressbar2-4.5.0}/.github/workflows/codeql.yml +0 -0
  67. {progressbar2-4.4.2 → progressbar2-4.5.0}/.github/workflows/main.yml +0 -0
  68. {progressbar2-4.4.2 → progressbar2-4.5.0}/.gitignore +0 -0
  69. {progressbar2-4.4.2 → progressbar2-4.5.0}/.pre-commit-config.yaml +0 -0
  70. {progressbar2-4.4.2 → progressbar2-4.5.0}/.readthedocs.yaml +0 -0
  71. {progressbar2-4.4.2 → progressbar2-4.5.0}/CHANGES.rst +0 -0
  72. {progressbar2-4.4.2 → progressbar2-4.5.0}/CONTRIBUTING.rst +0 -0
  73. {progressbar2-4.4.2 → progressbar2-4.5.0}/ISSUE_TEMPLATE +0 -0
  74. {progressbar2-4.4.2 → progressbar2-4.5.0}/LICENSE +0 -0
  75. {progressbar2-4.4.2 → progressbar2-4.5.0}/MANIFEST.in +0 -0
  76. {progressbar2-4.4.2 → progressbar2-4.5.0}/Makefile +0 -0
  77. {progressbar2-4.4.2 → progressbar2-4.5.0}/appveyor.yml +0 -0
  78. {progressbar2-4.4.2 → progressbar2-4.5.0}/circle.yml +0 -0
  79. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/.gitignore +0 -0
  80. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/Makefile +0 -0
  81. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/_theme/LICENSE +0 -0
  82. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/_theme/flask_theme_support.py +0 -0
  83. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/_theme/wolph/layout.html +0 -0
  84. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/_theme/wolph/relations.html +0 -0
  85. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/_theme/wolph/static/flasky.css_t +0 -0
  86. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/_theme/wolph/static/small_flask.css +0 -0
  87. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/_theme/wolph/theme.conf +0 -0
  88. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/contributing.rst +0 -0
  89. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/examples.rst +0 -0
  90. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/history.rst +0 -0
  91. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/index.rst +0 -0
  92. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/installation.rst +0 -0
  93. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/make.bat +0 -0
  94. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.algorithms.rst +0 -0
  95. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.bar.rst +0 -0
  96. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.base.rst +0 -0
  97. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.env.rst +0 -0
  98. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.multi.rst +0 -0
  99. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.rst +0 -0
  100. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.shortcuts.rst +0 -0
  101. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.terminal.base.rst +0 -0
  102. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.terminal.colors.rst +0 -0
  103. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.terminal.rst +0 -0
  104. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.terminal.stream.rst +0 -0
  105. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.utils.rst +0 -0
  106. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/progressbar.widgets.rst +0 -0
  107. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/requirements.txt +0 -0
  108. {progressbar2-4.4.2 → progressbar2-4.5.0}/docs/usage.rst +0 -0
  109. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/__init__.py +0 -0
  110. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/py.typed +0 -0
  111. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/terminal/__init__.py +0 -0
  112. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar/terminal/os_specific/__init__.py +0 -0
  113. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar2.egg-info/dependency_links.txt +0 -0
  114. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar2.egg-info/entry_points.txt +0 -0
  115. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar2.egg-info/requires.txt +0 -0
  116. {progressbar2-4.4.2 → progressbar2-4.5.0}/progressbar2.egg-info/top_level.txt +0 -0
  117. {progressbar2-4.4.2 → progressbar2-4.5.0}/pytest.ini +0 -0
  118. {progressbar2-4.4.2 → progressbar2-4.5.0}/requirements.txt +0 -0
  119. {progressbar2-4.4.2 → progressbar2-4.5.0}/setup.cfg +0 -0
  120. {progressbar2-4.4.2 → progressbar2-4.5.0}/tests/requirements.txt +0 -0
@@ -11,7 +11,7 @@ jobs:
11
11
  steps:
12
12
  - uses: actions/stale@v8
13
13
  with:
14
- days-before-stale: 30
14
+ days-before-issue-stale: 30
15
15
  exempt-issue-labels: in-progress,help-wanted,pinned,security,enhancement
16
- exempt-all-pr-assignees: true
16
+ exempt-all-assignees: true
17
17
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: progressbar2
3
- Version: 4.4.2
3
+ Version: 4.5.0
4
4
  Summary: A Python Progressbar library to provide visual (yet text based) progress to long running operations.
5
5
  Author-email: "Rick van Hattem (Wolph)" <wolph@wol.ph>
6
6
  License: BSD-3-Clause
@@ -153,14 +153,6 @@ of widgets:
153
153
  The progressbar module is very easy to use, yet very powerful. It will also
154
154
  automatically enable features like auto-resizing when the system supports it.
155
155
 
156
- ******************************************************************************
157
- Security contact information
158
- ******************************************************************************
159
-
160
- To report a security vulnerability, please use the
161
- `Tidelift security contact <https://tidelift.com/security>`_.
162
- Tidelift will coordinate the fix and disclosure.
163
-
164
156
  ******************************************************************************
165
157
  Known issues
166
158
  ******************************************************************************
@@ -71,14 +71,6 @@ of widgets:
71
71
  The progressbar module is very easy to use, yet very powerful. It will also
72
72
  automatically enable features like auto-resizing when the system supports it.
73
73
 
74
- ******************************************************************************
75
- Security contact information
76
- ******************************************************************************
77
-
78
- To report a security vulnerability, please use the
79
- `Tidelift security contact <https://tidelift.com/security>`_.
80
- Tidelift will coordinate the fix and disclosure.
81
-
82
74
  ******************************************************************************
83
75
  Known issues
84
76
  ******************************************************************************
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  #
2
4
  # Progress Bar documentation build configuration file, created by
3
5
  # sphinx-quickstart on Tue Aug 20 11:47:33 2013.
@@ -9,7 +11,6 @@
9
11
  #
10
12
  # All configuration values have a default; values that are commented out
11
13
  # serve to show the default.
12
-
13
14
  import datetime
14
15
  import os
15
16
  import sys
@@ -59,7 +60,7 @@ master_doc = 'index'
59
60
 
60
61
  # General information about the project.
61
62
  project = 'Progress Bar'
62
- project_slug = ''.join(project.capitalize().split())
63
+ project_slug: str = ''.join(project.capitalize().split())
63
64
  copyright = f'{datetime.date.today().year}, <a href="http://wol.ph/">{metadata.__author__}</a>'
64
65
 
65
66
  # The version info for the project you're documenting, acts as replacement for
@@ -67,9 +68,9 @@ copyright = f'{datetime.date.today().year}, <a href="http://wol.ph/">{metadata.
67
68
  # built documents.
68
69
  #
69
70
  # The short X.Y version.
70
- version = metadata.__version__
71
+ version: str = metadata.__version__
71
72
  # The full version, including alpha/beta/rc tags.
72
- release = metadata.__version__
73
+ release: str = metadata.__version__
73
74
 
74
75
  # The language for content autogenerated by Sphinx. Refer to documentation
75
76
  # for a list of supported languages.
@@ -202,7 +203,7 @@ latex_elements = {
202
203
 
203
204
  # Grouping the document tree into LaTeX files. List of tuples
204
205
  # (source start file, target name, title, author, documentclass [howto/manual]).
205
- latex_documents = [
206
+ latex_documents: list[tuple[str, ...]] = [
206
207
  (
207
208
  'index',
208
209
  f'{project_slug}.tex',
@@ -237,7 +238,7 @@ latex_documents = [
237
238
 
238
239
  # One entry per manual page. List of tuples
239
240
  # (source start file, name, description, authors, manual section).
240
- man_pages = [
241
+ man_pages: list[tuple[str, str, str, list[str], int]] = [
241
242
  (
242
243
  'index',
243
244
  project_slug.lower(),
@@ -256,7 +257,7 @@ man_pages = [
256
257
  # Grouping the document tree into Texinfo files. List of tuples
257
258
  # (source start file, target name, title, author,
258
259
  # dir menu entry, description, category)
259
- texinfo_documents = [
260
+ texinfo_documents: list[tuple[str, ...]] = [
260
261
  (
261
262
  'index',
262
263
  project_slug,
@@ -284,10 +285,10 @@ texinfo_documents = [
284
285
  # -- Options for Epub output ---------------------------------------------
285
286
 
286
287
  # Bibliographic Dublin Core info.
287
- epub_title = project
288
- epub_author = metadata.__author__
289
- epub_publisher = metadata.__author__
290
- epub_copyright = copyright
288
+ epub_title: str = project
289
+ epub_author: str = metadata.__author__
290
+ epub_publisher: str = metadata.__author__
291
+ epub_copyright: str = copyright
291
292
 
292
293
  # The language of the text. It defaults to the language option
293
294
  # or en if the language is not set.
@@ -340,4 +341,6 @@ epub_copyright = copyright
340
341
 
341
342
 
342
343
  # Example configuration for intersphinx: refer to the Python standard library.
343
- intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
344
+ intersphinx_mapping: dict[str, tuple[str, None]] = {
345
+ 'python': ('https://docs.python.org/3', None)
346
+ }
@@ -15,12 +15,12 @@ examples: list[typing.Callable[[typing.Any], typing.Any]] = []
15
15
 
16
16
 
17
17
  def example(fn):
18
- '''Wrap the examples so they generate readable output'''
18
+ """Wrap the examples so they generate readable output"""
19
19
 
20
20
  @functools.wraps(fn)
21
21
  def wrapped(*args, **kwargs):
22
22
  try:
23
- sys.stdout.write('Running: %s\n' % fn.__name__)
23
+ sys.stdout.write(f'Running: {fn.__name__}\n')
24
24
  fn(*args, **kwargs)
25
25
  sys.stdout.write('\n')
26
26
  except KeyboardInterrupt:
@@ -33,30 +33,32 @@ def example(fn):
33
33
 
34
34
 
35
35
  @example
36
- def fast_example():
37
- '''Updates bar really quickly to cause flickering'''
36
+ def fast_example() -> None:
37
+ """Updates bar really quickly to cause flickering"""
38
38
  with progressbar.ProgressBar(widgets=[progressbar.Bar()]) as bar:
39
39
  for i in range(100):
40
40
  bar.update(int(i / 10), force=True)
41
41
 
42
42
 
43
43
  @example
44
- def shortcut_example():
44
+ def shortcut_example() -> None:
45
45
  for _ in progressbar.progressbar(range(10)):
46
46
  time.sleep(0.1)
47
47
 
48
48
 
49
49
  @example
50
- def prefixed_shortcut_example():
50
+ def prefixed_shortcut_example() -> None:
51
51
  for _ in progressbar.progressbar(range(10), prefix='Hi: '):
52
52
  time.sleep(0.1)
53
53
 
54
54
 
55
55
  @example
56
- def parallel_bars_multibar_example():
56
+ def parallel_bars_multibar_example() -> None:
57
57
  if os.name == 'nt':
58
- print('Skipping multibar example on Windows due to threading '
59
- 'incompatibilities with the example code.')
58
+ print(
59
+ 'Skipping multibar example on Windows due to threading '
60
+ 'incompatibilities with the example code.'
61
+ )
60
62
  return
61
63
 
62
64
  BARS = 5
@@ -85,7 +87,7 @@ def parallel_bars_multibar_example():
85
87
 
86
88
 
87
89
  @example
88
- def multiple_bars_line_offset_example():
90
+ def multiple_bars_line_offset_example() -> None:
89
91
  BARS = 5
90
92
  N = 100
91
93
 
@@ -117,16 +119,16 @@ def multiple_bars_line_offset_example():
117
119
 
118
120
 
119
121
  @example
120
- def templated_shortcut_example():
122
+ def templated_shortcut_example() -> None:
121
123
  for _ in progressbar.progressbar(range(10), suffix='{seconds_elapsed:.1}'):
122
124
  time.sleep(0.1)
123
125
 
124
126
 
125
127
  @example
126
- def job_status_example():
128
+ def job_status_example() -> None:
127
129
  with progressbar.ProgressBar(
128
- redirect_stdout=True,
129
- widgets=[progressbar.widgets.JobStatusBar('status')],
130
+ redirect_stdout=True,
131
+ widgets=[progressbar.widgets.JobStatusBar('status')],
130
132
  ) as bar:
131
133
  for _ in range(30):
132
134
  print('random', random.random())
@@ -142,7 +144,7 @@ def job_status_example():
142
144
 
143
145
 
144
146
  @example
145
- def with_example_stdout_redirection():
147
+ def with_example_stdout_redirection() -> None:
146
148
  with progressbar.ProgressBar(max_value=10, redirect_stdout=True) as p:
147
149
  for i in range(10):
148
150
  if i % 3 == 0:
@@ -153,7 +155,7 @@ def with_example_stdout_redirection():
153
155
 
154
156
 
155
157
  @example
156
- def basic_widget_example():
158
+ def basic_widget_example() -> None:
157
159
  widgets = [progressbar.Percentage(), progressbar.Bar()]
158
160
  bar = progressbar.ProgressBar(widgets=widgets, max_value=10).start()
159
161
  for i in range(10):
@@ -164,7 +166,7 @@ def basic_widget_example():
164
166
 
165
167
 
166
168
  @example
167
- def color_bar_example():
169
+ def color_bar_example() -> None:
168
170
  widgets = [
169
171
  '\x1b[33mColorful example\x1b[39m',
170
172
  progressbar.Percentage(),
@@ -179,7 +181,7 @@ def color_bar_example():
179
181
 
180
182
 
181
183
  @example
182
- def color_bar_animated_marker_example():
184
+ def color_bar_animated_marker_example() -> None:
183
185
  widgets = [
184
186
  # Colored animated marker with colored fill:
185
187
  progressbar.Bar(
@@ -200,7 +202,7 @@ def color_bar_animated_marker_example():
200
202
 
201
203
 
202
204
  @example
203
- def multi_range_bar_example():
205
+ def multi_range_bar_example() -> None:
204
206
  markers = [
205
207
  '\x1b[32m█\x1b[39m', # Done
206
208
  '\x1b[33m#\x1b[39m', # Processing
@@ -229,7 +231,7 @@ def multi_range_bar_example():
229
231
 
230
232
 
231
233
  @example
232
- def multi_progress_bar_example(left=True):
234
+ def multi_progress_bar_example(left: bool = True) -> None:
233
235
  jobs = [
234
236
  # Each job takes between 1 and 10 steps to complete
235
237
  [0, random.randint(1, 10)]
@@ -261,7 +263,7 @@ def multi_progress_bar_example(left=True):
261
263
 
262
264
 
263
265
  @example
264
- def granular_progress_example():
266
+ def granular_progress_example() -> None:
265
267
  widgets = [
266
268
  progressbar.GranularBar(markers=' ▏▎▍▌▋▊▉█', left='', right='|'),
267
269
  progressbar.GranularBar(markers=' ▁▂▃▄▅▆▇█', left='', right='|'),
@@ -278,7 +280,7 @@ def granular_progress_example():
278
280
 
279
281
 
280
282
  @example
281
- def percentage_label_bar_example():
283
+ def percentage_label_bar_example() -> None:
282
284
  widgets = [progressbar.PercentageLabelBar()]
283
285
  bar = progressbar.ProgressBar(widgets=widgets, max_value=10).start()
284
286
  for i in range(10):
@@ -289,7 +291,7 @@ def percentage_label_bar_example():
289
291
 
290
292
 
291
293
  @example
292
- def file_transfer_example():
294
+ def file_transfer_example() -> None:
293
295
  widgets = [
294
296
  'Test: ',
295
297
  progressbar.Percentage(),
@@ -309,11 +311,11 @@ def file_transfer_example():
309
311
 
310
312
 
311
313
  @example
312
- def custom_file_transfer_example():
314
+ def custom_file_transfer_example() -> None:
313
315
  class CrazyFileTransferSpeed(progressbar.FileTransferSpeed):
314
- '''
316
+ """
315
317
  It's bigger between 45 and 80 percent
316
- '''
318
+ """
317
319
 
318
320
  def update(self, bar):
319
321
  if 45 < bar.percentage() < 80:
@@ -343,7 +345,7 @@ def custom_file_transfer_example():
343
345
 
344
346
 
345
347
  @example
346
- def double_bar_example():
348
+ def double_bar_example() -> None:
347
349
  widgets = [
348
350
  progressbar.Bar('>'),
349
351
  ' ',
@@ -360,7 +362,7 @@ def double_bar_example():
360
362
 
361
363
 
362
364
  @example
363
- def basic_file_transfer():
365
+ def basic_file_transfer() -> None:
364
366
  widgets = [
365
367
  'Test: ',
366
368
  progressbar.Percentage(),
@@ -381,7 +383,7 @@ def basic_file_transfer():
381
383
 
382
384
 
383
385
  @example
384
- def simple_progress():
386
+ def simple_progress() -> None:
385
387
  bar = progressbar.ProgressBar(
386
388
  widgets=[progressbar.SimpleProgress()],
387
389
  max_value=17,
@@ -393,7 +395,7 @@ def simple_progress():
393
395
 
394
396
 
395
397
  @example
396
- def basic_progress():
398
+ def basic_progress() -> None:
397
399
  bar = progressbar.ProgressBar().start()
398
400
  for i in range(10):
399
401
  time.sleep(0.1)
@@ -402,7 +404,7 @@ def basic_progress():
402
404
 
403
405
 
404
406
  @example
405
- def progress_with_automatic_max():
407
+ def progress_with_automatic_max() -> None:
406
408
  # Progressbar can guess max_value automatically.
407
409
  bar = progressbar.ProgressBar()
408
410
  for _ in bar(range(8)):
@@ -410,7 +412,7 @@ def progress_with_automatic_max():
410
412
 
411
413
 
412
414
  @example
413
- def progress_with_unavailable_max():
415
+ def progress_with_unavailable_max() -> None:
414
416
  # Progressbar can't guess max_value.
415
417
  bar = progressbar.ProgressBar(max_value=8)
416
418
  for _ in bar(i for i in range(8)):
@@ -418,7 +420,7 @@ def progress_with_unavailable_max():
418
420
 
419
421
 
420
422
  @example
421
- def animated_marker():
423
+ def animated_marker() -> None:
422
424
  bar = progressbar.ProgressBar(
423
425
  widgets=['Working: ', progressbar.AnimatedMarker()]
424
426
  )
@@ -427,7 +429,7 @@ def animated_marker():
427
429
 
428
430
 
429
431
  @example
430
- def filling_bar_animated_marker():
432
+ def filling_bar_animated_marker() -> None:
431
433
  bar = progressbar.ProgressBar(
432
434
  widgets=[
433
435
  progressbar.Bar(
@@ -440,7 +442,7 @@ def filling_bar_animated_marker():
440
442
 
441
443
 
442
444
  @example
443
- def counter_and_timer():
445
+ def counter_and_timer() -> None:
444
446
  widgets = [
445
447
  'Processed: ',
446
448
  progressbar.Counter('Counter: %(value)05d'),
@@ -454,7 +456,7 @@ def counter_and_timer():
454
456
 
455
457
 
456
458
  @example
457
- def format_label():
459
+ def format_label() -> None:
458
460
  widgets = [
459
461
  progressbar.FormatLabel('Processed: %(value)d lines (in: %(elapsed)s)')
460
462
  ]
@@ -464,7 +466,7 @@ def format_label():
464
466
 
465
467
 
466
468
  @example
467
- def animated_balloons():
469
+ def animated_balloons() -> None:
468
470
  widgets = ['Balloon: ', progressbar.AnimatedMarker(markers='.oO@* ')]
469
471
  bar = progressbar.ProgressBar(widgets=widgets)
470
472
  for _ in bar(i for i in range(24)):
@@ -472,7 +474,7 @@ def animated_balloons():
472
474
 
473
475
 
474
476
  @example
475
- def animated_arrows():
477
+ def animated_arrows() -> None:
476
478
  # You may need python 3.x to see this correctly
477
479
  try:
478
480
  widgets = ['Arrows: ', progressbar.AnimatedMarker(markers='←↖↑↗→↘↓↙')]
@@ -484,7 +486,7 @@ def animated_arrows():
484
486
 
485
487
 
486
488
  @example
487
- def animated_filled_arrows():
489
+ def animated_filled_arrows() -> None:
488
490
  # You may need python 3.x to see this correctly
489
491
  try:
490
492
  widgets = ['Arrows: ', progressbar.AnimatedMarker(markers='◢◣◤◥')]
@@ -496,7 +498,7 @@ def animated_filled_arrows():
496
498
 
497
499
 
498
500
  @example
499
- def animated_wheels():
501
+ def animated_wheels() -> None:
500
502
  # You may need python 3.x to see this correctly
501
503
  try:
502
504
  widgets = ['Wheels: ', progressbar.AnimatedMarker(markers='◐◓◑◒')]
@@ -508,7 +510,7 @@ def animated_wheels():
508
510
 
509
511
 
510
512
  @example
511
- def format_label_bouncer():
513
+ def format_label_bouncer() -> None:
512
514
  widgets = [
513
515
  progressbar.FormatLabel('Bouncer: value %(value)d - '),
514
516
  progressbar.BouncingBar(),
@@ -519,7 +521,7 @@ def format_label_bouncer():
519
521
 
520
522
 
521
523
  @example
522
- def format_label_rotating_bouncer():
524
+ def format_label_rotating_bouncer() -> None:
523
525
  widgets = [
524
526
  progressbar.FormatLabel('Animated Bouncer: value %(value)d - '),
525
527
  progressbar.BouncingBar(marker=progressbar.RotatingMarker()),
@@ -531,9 +533,9 @@ def format_label_rotating_bouncer():
531
533
 
532
534
 
533
535
  @example
534
- def with_right_justify():
536
+ def with_right_justify() -> None:
535
537
  with progressbar.ProgressBar(
536
- max_value=10, term_width=20, left_justify=False
538
+ max_value=10, term_width=20, left_justify=False
537
539
  ) as progress:
538
540
  assert progress.term_width is not None
539
541
  for i in range(10):
@@ -541,38 +543,39 @@ def with_right_justify():
541
543
 
542
544
 
543
545
  @example
544
- def exceeding_maximum():
546
+ def exceeding_maximum() -> None:
545
547
  with progressbar.ProgressBar(max_value=1) as progress, contextlib.suppress(
546
- ValueError):
548
+ ValueError
549
+ ):
547
550
  progress.update(2)
548
551
 
549
552
 
550
553
  @example
551
- def reaching_maximum():
554
+ def reaching_maximum() -> None:
552
555
  progress = progressbar.ProgressBar(max_value=1)
553
556
  with contextlib.suppress(RuntimeError):
554
557
  progress.update(1)
555
558
 
556
559
 
557
560
  @example
558
- def stdout_redirection():
561
+ def stdout_redirection() -> None:
559
562
  with progressbar.ProgressBar(redirect_stdout=True) as progress:
560
563
  print('', file=sys.stdout)
561
564
  progress.update(0)
562
565
 
563
566
 
564
567
  @example
565
- def stderr_redirection():
568
+ def stderr_redirection() -> None:
566
569
  with progressbar.ProgressBar(redirect_stderr=True) as progress:
567
570
  print('', file=sys.stderr)
568
571
  progress.update(0)
569
572
 
570
573
 
571
574
  @example
572
- def rotating_bouncing_marker():
575
+ def rotating_bouncing_marker() -> None:
573
576
  widgets = [progressbar.BouncingBar(marker=progressbar.RotatingMarker())]
574
577
  with progressbar.ProgressBar(
575
- widgets=widgets, max_value=20, term_width=10
578
+ widgets=widgets, max_value=20, term_width=10
576
579
  ) as progress:
577
580
  for i in range(20):
578
581
  time.sleep(0.1)
@@ -584,7 +587,7 @@ def rotating_bouncing_marker():
584
587
  )
585
588
  ]
586
589
  with progressbar.ProgressBar(
587
- widgets=widgets, max_value=20, term_width=10
590
+ widgets=widgets, max_value=20, term_width=10
588
591
  ) as progress:
589
592
  for i in range(20):
590
593
  time.sleep(0.1)
@@ -592,7 +595,7 @@ def rotating_bouncing_marker():
592
595
 
593
596
 
594
597
  @example
595
- def incrementing_bar():
598
+ def incrementing_bar() -> None:
596
599
  bar = progressbar.ProgressBar(
597
600
  widgets=[
598
601
  progressbar.Percentage(),
@@ -608,7 +611,7 @@ def incrementing_bar():
608
611
 
609
612
 
610
613
  @example
611
- def increment_bar_with_output_redirection():
614
+ def increment_bar_with_output_redirection() -> None:
612
615
  widgets = [
613
616
  'Test: ',
614
617
  progressbar.Percentage(),
@@ -631,7 +634,7 @@ def increment_bar_with_output_redirection():
631
634
 
632
635
 
633
636
  @example
634
- def eta_types_demonstration():
637
+ def eta_types_demonstration() -> None:
635
638
  widgets = [
636
639
  progressbar.Percentage(),
637
640
  ' ETA: ',
@@ -665,7 +668,7 @@ def eta_types_demonstration():
665
668
 
666
669
 
667
670
  @example
668
- def adaptive_eta_without_value_change():
671
+ def adaptive_eta_without_value_change() -> None:
669
672
  # Testing progressbar.AdaptiveETA when the value doesn't actually change
670
673
  bar = progressbar.ProgressBar(
671
674
  widgets=[
@@ -683,7 +686,7 @@ def adaptive_eta_without_value_change():
683
686
 
684
687
 
685
688
  @example
686
- def iterator_with_max_value():
689
+ def iterator_with_max_value() -> None:
687
690
  # Testing using progressbar as an iterator with a max value
688
691
  bar = progressbar.ProgressBar()
689
692
 
@@ -693,7 +696,7 @@ def iterator_with_max_value():
693
696
 
694
697
 
695
698
  @example
696
- def eta():
699
+ def eta() -> None:
697
700
  widgets = [
698
701
  'Test: ',
699
702
  progressbar.Percentage(),
@@ -712,7 +715,7 @@ def eta():
712
715
 
713
716
 
714
717
  @example
715
- def variables():
718
+ def variables() -> None:
716
719
  # Use progressbar.Variable to keep track of some parameter(s) during
717
720
  # your calculations
718
721
  widgets = [
@@ -733,7 +736,7 @@ def variables():
733
736
 
734
737
 
735
738
  @example
736
- def user_variables():
739
+ def user_variables() -> None:
737
740
  tasks = {
738
741
  'Download': [
739
742
  'SDK',
@@ -757,9 +760,9 @@ def user_variables():
757
760
  num_subtasks = sum(len(x) for x in tasks.values())
758
761
 
759
762
  with progressbar.ProgressBar(
760
- prefix='{variables.task} >> {variables.subtask}',
761
- variables={'task': '--', 'subtask': '--'},
762
- max_value=10 * num_subtasks,
763
+ prefix='{variables.task} >> {variables.subtask}',
764
+ variables={'task': '--', 'subtask': '--'},
765
+ max_value=10 * num_subtasks,
763
766
  ) as bar:
764
767
  for tasks_name, subtasks in tasks.items():
765
768
  for subtask_name in subtasks:
@@ -771,7 +774,7 @@ def user_variables():
771
774
 
772
775
 
773
776
  @example
774
- def format_custom_text():
777
+ def format_custom_text() -> None:
775
778
  format_custom_text = progressbar.FormatCustomText(
776
779
  'Spam: %(spam).1f kg, eggs: %(eggs)d',
777
780
  dict(
@@ -793,7 +796,7 @@ def format_custom_text():
793
796
 
794
797
 
795
798
  @example
796
- def simple_api_example():
799
+ def simple_api_example() -> None:
797
800
  bar = progressbar.ProgressBar(widget_kwargs=dict(fill='█'))
798
801
  for _ in bar(range(200)):
799
802
  time.sleep(0.02)
@@ -838,7 +841,7 @@ def percentage_on_generators():
838
841
  time.sleep(0.02)
839
842
 
840
843
 
841
- def test(*tests):
844
+ def test(*tests) -> None:
842
845
  if tests:
843
846
  no_tests = True
844
847
  for example in examples:
@@ -1,4 +1,4 @@
1
- '''Text progress bar library for Python.
1
+ """Text progress bar library for Python.
2
2
 
3
3
  A text progress bar is typically used to display the progress of a long
4
4
  running operation, providing a visual cue that processing is underway.
@@ -9,19 +9,19 @@ differently depending on the state of the progress bar.
9
9
 
10
10
  The progressbar module is very easy to use, yet very powerful. It will also
11
11
  automatically enable features like auto-resizing when the system supports it.
12
- '''
12
+ """
13
13
 
14
14
  __title__ = 'Python Progressbar'
15
15
  __package_name__ = 'progressbar2'
16
16
  __author__ = 'Rick van Hattem (Wolph)'
17
- __description__ = ' '.join(
18
- '''
17
+ __description__: str = ' '.join(
18
+ """
19
19
  A Python Progressbar library to provide visual (yet text based) progress to
20
20
  long running operations.
21
- '''.strip().split(),
21
+ """.strip().split(),
22
22
  )
23
23
  __email__ = 'wolph@wol.ph'
24
- __version__ = '4.4.2'
24
+ __version__ = '4.5.0'
25
25
  __license__ = 'BSD'
26
26
  __copyright__ = 'Copyright 2015 Rick van Hattem (Wolph)'
27
27
  __url__ = 'https://github.com/WoLpH/python-progressbar'