Codebase list golang-github-vbauerster-mpb / cf6bc3e
uncapitalize comments Vladimir Bauer 8 years ago
4 changed file(s) with 15 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
4242 // adding a single bar
4343 bar := p.AddBar(int64(total),
4444 mpb.PrependDecorators(
45 // Display our name with one space on the right
45 // display our name with one space on the right
4646 decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}),
47 // Replace ETA decorator with "done" message, OnComplete event
47 // replace ETA decorator with "done" message, OnComplete event
4848 decor.OnComplete(
4949 // ETA decorator with default eta age, and width reservation of 4
5050 decor.ETA(decor.ET_STYLE_GO, 0, startBlock, decor.WC{W: 4}), "done",
5959 // update start block time, required for ETA calculation
6060 startBlock <- time.Now()
6161 time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
62 // Increment by 1 (there is bar.IncrBy(int) method, if needed)
62 // increment by 1 (there is bar.IncrBy(int) method, if needed)
6363 bar.Increment()
6464 }
6565 // wait for our bar to complete and flush
7878 startBlock := make(chan time.Time)
7979 bar := p.AddBar(int64(total),
8080 mpb.PrependDecorators(
81 // Display our name with one space on the right
81 // display our name with one space on the right
8282 decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}),
8383 // decor.DSyncWidth bit enables same column width synchronization
8484 decor.Percentage(decor.WCSyncWidth),
8585 ),
8686 mpb.AppendDecorators(
87 // Replace ETA decorator with "done" message, OnComplete event
87 // replace ETA decorator with "done" message, OnComplete event
8888 decor.OnComplete(
8989 // ETA decorator with default eta age, and width reservation of 3
9090 decor.ETA(decor.ET_STYLE_GO, 0, startBlock, decor.WC{W: 3}), "done",
2626 // adding a single bar
2727 bar := p.AddBar(int64(total),
2828 mpb.PrependDecorators(
29 // Display our name with one space on the right
29 // display our name with one space on the right
3030 decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}),
31 // Replace ETA decorator with message, OnComplete event
31 // replace ETA decorator with "done" message, OnComplete event
3232 decor.OnComplete(
3333 // ETA decorator with default eta age, and width reservation of 4
34 decor.ETA(decor.ET_STYLE_GO, 0, startBlock, decor.WC{W: 4}),
35 "done",
34 decor.ETA(decor.ET_STYLE_GO, 0, startBlock, decor.WC{W: 4}), "done",
3635 ),
3736 ),
38 mpb.AppendDecorators(
39 decor.Percentage(),
40 ),
37 mpb.AppendDecorators(decor.Percentage()),
4138 )
4239
4340 // simulating some work
4643 // update start block time, required for ETA calculation
4744 startBlock <- time.Now()
4845 time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
49 // Increment by 1 (there is bar.IncrBy(int) method, if needed)
46 // increment by 1 (there is bar.IncrBy(int) method, if needed)
5047 bar.Increment()
5148 }
5249 // wait for our bar to complete and flush
2424 startBlock := make(chan time.Time)
2525 bar := p.AddBar(int64(total),
2626 mpb.PrependDecorators(
27 // Display our name with one space on the right
27 // display our name with one space on the right
2828 decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}),
2929 // decor.DSyncWidth bit enables same column width synchronization
3030 decor.Percentage(decor.WCSyncWidth),
3131 ),
3232 mpb.AppendDecorators(
33 // Replace ETA decorator with "done" message, OnComplete event
33 // replace ETA decorator with "done" message, OnComplete event
3434 decor.OnComplete(
3535 // ETA decorator with default eta age, and width reservation of 3
3636 decor.ETA(decor.ET_STYLE_GO, 0, startBlock, decor.WC{W: 3}), "done",
2323 // adding a single bar
2424 bar := p.AddBar(int64(total),
2525 mpb.PrependDecorators(
26 // Display our name with one space on the right
26 // display our name with one space on the right
2727 decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}),
28 // Replace ETA decorator with "done" message, OnComplete event
28 // replace ETA decorator with "done" message, OnComplete event
2929 decor.OnComplete(
3030 // ETA decorator with default eta age, and width reservation of 4
3131 decor.ETA(decor.ET_STYLE_GO, 0, startBlock, decor.WC{W: 4}), "done",
4040 // update start block time, required for ETA calculation
4141 startBlock <- time.Now()
4242 time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
43 // Increment by 1 (there is bar.IncrBy(int) method, if needed)
43 // increment by 1 (there is bar.IncrBy(int) method, if needed)
4444 bar.Increment()
4545 }
4646 // wait for our bar to complete and flush