Skip to content

Commit eb35f2f

Browse files
committed
Merge branch 'job-status' into develop
2 parents 609cfc1 + 200aaf7 commit eb35f2f

3 files changed

Lines changed: 348 additions & 218 deletions

File tree

examples.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ def templated_shortcut_example():
5656
time.sleep(0.1)
5757

5858

59+
@example
60+
def job_status_example():
61+
with progressbar.ProgressBar(
62+
redirect_stdout=True,
63+
widgets=[progressbar.widgets.JobStatusBar('status')],
64+
) as bar:
65+
for i in range(30):
66+
print('random', random.random())
67+
bar.increment(status=random.random() > 0.5)
68+
time.sleep(0.1)
69+
70+
5971
@example
6072
def with_example_stdout_redirection():
6173
with progressbar.ProgressBar(max_value=10, redirect_stdout=True) as p:

progressbar/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
Timer,
3535
Variable,
3636
VariableMixin,
37+
JobStatusBar,
3738
)
3839

3940
__date__ = str(date.today())
@@ -76,4 +77,5 @@
7677
'LineOffsetStreamWrapper',
7778
'MultiBar',
7879
'SortKey',
80+
'JobStatusBar',
7981
]

0 commit comments

Comments
 (0)