Codebase list golang-github-vbauerster-mpb / 6eaf1d3
Refactoring: Name => StaticName Vladimir Bauer 8 years ago
9 changed file(s) with 9 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
9292 name := fmt.Sprintf("Bar#%d:", i)
9393 bar := p.AddBar(int64(total),
9494 mpb.PrependDecorators(
95 decor.Name(name, len(name), 0),
95 decor.StaticName(name, 0, 0),
9696 decor.Percentage(3, decor.DSyncSpace),
9797 ),
9898 mpb.AppendDecorators(
3232 name := fmt.Sprintf("Bar#%d:", i)
3333 bar := p.AddBar(int64(total), mpb.BarID(i),
3434 mpb.PrependDecorators(
35 decor.Name(name, 0, decor.DwidthSync|decor.DidentRight),
35 decor.StaticName(name, 0, decor.DwidthSync|decor.DidentRight),
3636 decor.ETA(4, decor.DSyncSpace),
3737 ),
3838 mpb.AppendDecorators(
6161 // create bar with appropriate decorators
6262 bar := p.AddBar(size,
6363 mpb.PrependDecorators(
64 decor.Name(name, 0, 0),
64 decor.StaticName(name, 0, 0),
6565 decor.Counters("%3s / %3s", decor.Unit_KiB, 18, 0),
6666 ),
6767 mpb.AppendDecorators(decor.ETA(5, decor.DwidthSync)),
2929 }
3030 b := p.AddBar(int64(total),
3131 mpb.PrependDecorators(
32 decor.Name(name, 0, decor.DwidthSync|decor.DidentRight),
32 decor.StaticName(name, 0, decor.DwidthSync|decor.DidentRight),
3333 decor.ETA(4, decor.DSyncSpace),
3434 ),
3535 mpb.AppendDecorators(
2929 }
3030 b := p.AddBar(int64(total),
3131 mpb.PrependDecorators(
32 decor.Name(name, 0, decor.DwidthSync|decor.DidentRight),
32 decor.StaticName(name, 0, decor.DwidthSync|decor.DidentRight),
3333 decor.Elapsed(3, decor.DSyncSpace),
3434 ),
3535 mpb.AppendDecorators(
2929 }
3030 b := p.AddBar(int64(total), mpb.BarID(i),
3131 mpb.PrependDecorators(
32 decor.Name(name, 0, decor.DwidthSync|decor.DidentRight),
32 decor.StaticName(name, 0, decor.DwidthSync|decor.DidentRight),
3333 decor.ETA(4, decor.DSyncSpace),
3434 ),
3535 mpb.AppendDecorators(
2020 name := fmt.Sprintf("Bar#%d:", i)
2121 bar := p.AddBar(int64(total),
2222 mpb.PrependDecorators(
23 // Name decorator with minWidth and no width sync options
24 decor.Name(name, len(name), 0),
25 // Percentage decorator with minWidth and width sync options DwidthSync|DextraSpace
23 decor.StaticName(name, 0, 0),
2624 decor.Percentage(3, decor.DSyncSpace),
2725 ),
2826 mpb.AppendDecorators(
29 // ETA decorator, with no width sync
3027 decor.ETA(2, 0),
3128 ),
3229 )
4848 }
4949 b := p.AddBar(int64(total),
5050 mpb.PrependDecorators(
51 decor.Name(name, 0, decor.DwidthSync),
51 decor.StaticName(name, 0, decor.DwidthSync),
5252 decor.Counters("%3s/%3s", 0, 10, decor.DSyncSpace),
5353 ),
5454 mpb.AppendDecorators(
2525 total := rand.Intn(120) + 10
2626 bar := p.AddBar(int64(total),
2727 mpb.PrependDecorators(
28 decor.Name(name, len(name), 0),
28 decor.StaticName(name, len(name), 0),
2929 decor.ETA(4, decor.DSyncSpace),
3030 ),
3131 mpb.AppendDecorators(