@@ -1714,7 +1714,7 @@ example:
17141714 ... processed.append(item)
17151715 >> > items = [' i1' , ' i2' , ' i3' , ' i4' , ' i5' , ' i6' , ' i7' , ' i8' , ' i9' , ' i10' ]
17161716
1717- >> > for item in ProgressBar(items, prefix = ' Progress: ' , width = 60 ):
1717+ >> > for item in ProgressBar(items, prefix = ' Progress: ' , width = 70 ):
17181718 ... process(item)
17191719 Progress: ⋅⋅⋅⋅⋅9 ⋅⋅⋅⋅⋅8 ⋅⋅⋅⋅⋅7 ⋅⋅⋅⋅⋅6 ⋅⋅⋅⋅⋅5 ⋅⋅⋅⋅⋅4 ⋅⋅⋅⋅⋅3 ⋅⋅⋅⋅⋅2 ⋅⋅⋅⋅⋅1 ⋅⋅⋅⋅⋅0
17201720
@@ -1728,7 +1728,7 @@ how many iterations you wish:
17281728
17291729 >> > for i in ProgressBar(50 , prefix = ' Progress: ' ):
17301730 ... process(i)
1731- Progress: ⋅⋅⋅⋅⋅⋅ 9 ⋅⋅⋅⋅⋅⋅ 8 ⋅⋅⋅⋅⋅⋅ 7 ⋅⋅⋅⋅⋅⋅ 6 ⋅⋅⋅⋅⋅⋅ 5 ⋅⋅⋅⋅⋅⋅ 4 ⋅⋅⋅⋅⋅⋅ 3 ⋅⋅⋅⋅⋅⋅ 2 ⋅⋅⋅⋅⋅⋅ 1 ⋅ ⋅⋅⋅⋅⋅0
1731+ Progress: ⋅⋅⋅⋅⋅9 ⋅⋅⋅⋅⋅8 ⋅⋅⋅⋅⋅7 ⋅⋅⋅⋅⋅6 ⋅⋅⋅⋅⋅5 ⋅⋅⋅⋅⋅4 ⋅⋅⋅⋅⋅3 ⋅⋅⋅⋅⋅2 ⋅⋅⋅⋅⋅1 ⋅⋅⋅⋅⋅0
17321732
17331733 Finally, the third illustrates progress through a continuous range:
17341734
@@ -1813,7 +1813,7 @@ results: *okay*, *warn*, *fail*, *error*.
18131813 ... for i in range (len (results)):
18141814 ... status = results[i]
18151815 ... progress.draw(i+ 1 , status)
1816- progress: ⋅⋅⋅⋅⋅⋅ 9 ⋅⋅⋅⋅⋅⋅ 8 ⋅⋅⋅⋅⋅⋅ 7 ++++++ 6 ⋅⋅⋅⋅⋅⋅ 5 ++++++ 4 ⋅⋅⋅⋅⋅⋅ 3 ×××××× 2 −−−−−− 1 ⋅ ⋅⋅⋅⋅⋅0
1816+ progress: ⋅⋅⋅⋅⋅9 ⋅⋅⋅⋅⋅8 ⋅⋅⋅⋅⋅7 ++++ + 6 ⋅⋅⋅⋅⋅5 ++++ + 4 ⋅⋅⋅⋅⋅3 ×××××2 −−−−−1 ⋅⋅⋅⋅⋅0
18171817
18181818 In this case color was not used, but you could specify the following to render
18191819the markers in color:
@@ -1845,9 +1845,9 @@ The progress bar generally handles interruptions with grace. For example:
18451845 >> > for item in ProgressBar(items, prefix = ' Progress: ' , width = 60 ):
18461846 ... if item == ' i4' :
18471847 ... warn(' bad value.' , culprit = item)
1848- Progress: ⋅⋅⋅⋅⋅ 9 ⋅⋅⋅⋅⋅ 8 ⋅ ⋅⋅⋅⋅7
1848+ Progress: ⋅⋅⋅⋅9 ⋅⋅⋅⋅8 ⋅⋅⋅⋅7
18491849 myprog warning: i4: bad value.
1850- Progress: ⋅⋅⋅⋅⋅ 9 ⋅⋅⋅⋅⋅ 8 ⋅⋅⋅⋅⋅ 7 ⋅⋅⋅⋅⋅ 6 ⋅⋅⋅⋅⋅ 5 ⋅⋅⋅⋅⋅ 4 ⋅⋅⋅⋅⋅ 3 ⋅⋅⋅⋅⋅ 2 ⋅⋅⋅⋅⋅ 1 ⋅ ⋅⋅⋅⋅0
1850+ Progress: ⋅⋅⋅⋅9 ⋅⋅⋅⋅8 ⋅⋅⋅⋅7 ⋅⋅⋅⋅6 ⋅⋅⋅⋅5 ⋅⋅⋅⋅4 ⋅⋅⋅⋅3 ⋅⋅⋅⋅2 ⋅⋅⋅⋅1 ⋅⋅⋅⋅0
18511851
18521852 Notice that the warning started on a new line and the progress bar was restarted
18531853from the beginning after the warning.
0 commit comments