uncapitalize comments
Vladimir Bauer
8 years ago
| 42 | 42 | // adding a single bar |
| 43 | 43 | bar := p.AddBar(int64(total), |
| 44 | 44 | mpb.PrependDecorators( |
| 45 | // Display our name with one space on the right | |
| 45 | // display our name with one space on the right | |
| 46 | 46 | 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 | |
| 48 | 48 | decor.OnComplete( |
| 49 | 49 | // ETA decorator with default eta age, and width reservation of 4 |
| 50 | 50 | decor.ETA(decor.ET_STYLE_GO, 0, startBlock, decor.WC{W: 4}), "done", |
| 59 | 59 | // update start block time, required for ETA calculation |
| 60 | 60 | startBlock <- time.Now() |
| 61 | 61 | 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) | |
| 63 | 63 | bar.Increment() |
| 64 | 64 | } |
| 65 | 65 | // wait for our bar to complete and flush |
| 78 | 78 | startBlock := make(chan time.Time) |
| 79 | 79 | bar := p.AddBar(int64(total), |
| 80 | 80 | mpb.PrependDecorators( |
| 81 | // Display our name with one space on the right | |
| 81 | // display our name with one space on the right | |
| 82 | 82 | decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}), |
| 83 | 83 | // decor.DSyncWidth bit enables same column width synchronization |
| 84 | 84 | decor.Percentage(decor.WCSyncWidth), |
| 85 | 85 | ), |
| 86 | 86 | mpb.AppendDecorators( |
| 87 | // Replace ETA decorator with "done" message, OnComplete event | |
| 87 | // replace ETA decorator with "done" message, OnComplete event | |
| 88 | 88 | decor.OnComplete( |
| 89 | 89 | // ETA decorator with default eta age, and width reservation of 3 |
| 90 | 90 | decor.ETA(decor.ET_STYLE_GO, 0, startBlock, decor.WC{W: 3}), "done", |
| 26 | 26 | // adding a single bar |
| 27 | 27 | bar := p.AddBar(int64(total), |
| 28 | 28 | mpb.PrependDecorators( |
| 29 | // Display our name with one space on the right | |
| 29 | // display our name with one space on the right | |
| 30 | 30 | 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 | |
| 32 | 32 | decor.OnComplete( |
| 33 | 33 | // 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", | |
| 36 | 35 | ), |
| 37 | 36 | ), |
| 38 | mpb.AppendDecorators( | |
| 39 | decor.Percentage(), | |
| 40 | ), | |
| 37 | mpb.AppendDecorators(decor.Percentage()), | |
| 41 | 38 | ) |
| 42 | 39 | |
| 43 | 40 | // simulating some work |
| 46 | 43 | // update start block time, required for ETA calculation |
| 47 | 44 | startBlock <- time.Now() |
| 48 | 45 | 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) | |
| 50 | 47 | bar.Increment() |
| 51 | 48 | } |
| 52 | 49 | // wait for our bar to complete and flush |
| 24 | 24 | startBlock := make(chan time.Time) |
| 25 | 25 | bar := p.AddBar(int64(total), |
| 26 | 26 | mpb.PrependDecorators( |
| 27 | // Display our name with one space on the right | |
| 27 | // display our name with one space on the right | |
| 28 | 28 | decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}), |
| 29 | 29 | // decor.DSyncWidth bit enables same column width synchronization |
| 30 | 30 | decor.Percentage(decor.WCSyncWidth), |
| 31 | 31 | ), |
| 32 | 32 | mpb.AppendDecorators( |
| 33 | // Replace ETA decorator with "done" message, OnComplete event | |
| 33 | // replace ETA decorator with "done" message, OnComplete event | |
| 34 | 34 | decor.OnComplete( |
| 35 | 35 | // ETA decorator with default eta age, and width reservation of 3 |
| 36 | 36 | decor.ETA(decor.ET_STYLE_GO, 0, startBlock, decor.WC{W: 3}), "done", |
| 23 | 23 | // adding a single bar |
| 24 | 24 | bar := p.AddBar(int64(total), |
| 25 | 25 | mpb.PrependDecorators( |
| 26 | // Display our name with one space on the right | |
| 26 | // display our name with one space on the right | |
| 27 | 27 | 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 | |
| 29 | 29 | decor.OnComplete( |
| 30 | 30 | // ETA decorator with default eta age, and width reservation of 4 |
| 31 | 31 | decor.ETA(decor.ET_STYLE_GO, 0, startBlock, decor.WC{W: 4}), "done", |
| 40 | 40 | // update start block time, required for ETA calculation |
| 41 | 41 | startBlock <- time.Now() |
| 42 | 42 | 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) | |
| 44 | 44 | bar.Increment() |
| 45 | 45 | } |
| 46 | 46 | // wait for our bar to complete and flush |