Refactoring: Name => StaticName
Vladimir Bauer
8 years ago
| 92 | 92 |
name := fmt.Sprintf("Bar#%d:", i)
|
| 93 | 93 |
bar := p.AddBar(int64(total),
|
| 94 | 94 |
mpb.PrependDecorators(
|
| 95 | |
decor.Name(name, len(name), 0),
|
|
95 |
decor.StaticName(name, 0, 0),
|
| 96 | 96 |
decor.Percentage(3, decor.DSyncSpace),
|
| 97 | 97 |
),
|
| 98 | 98 |
mpb.AppendDecorators(
|
| 32 | 32 |
name := fmt.Sprintf("Bar#%d:", i)
|
| 33 | 33 |
bar := p.AddBar(int64(total), mpb.BarID(i),
|
| 34 | 34 |
mpb.PrependDecorators(
|
| 35 | |
decor.Name(name, 0, decor.DwidthSync|decor.DidentRight),
|
|
35 |
decor.StaticName(name, 0, decor.DwidthSync|decor.DidentRight),
|
| 36 | 36 |
decor.ETA(4, decor.DSyncSpace),
|
| 37 | 37 |
),
|
| 38 | 38 |
mpb.AppendDecorators(
|
| 61 | 61 |
// create bar with appropriate decorators
|
| 62 | 62 |
bar := p.AddBar(size,
|
| 63 | 63 |
mpb.PrependDecorators(
|
| 64 | |
decor.Name(name, 0, 0),
|
|
64 |
decor.StaticName(name, 0, 0),
|
| 65 | 65 |
decor.Counters("%3s / %3s", decor.Unit_KiB, 18, 0),
|
| 66 | 66 |
),
|
| 67 | 67 |
mpb.AppendDecorators(decor.ETA(5, decor.DwidthSync)),
|
| 29 | 29 |
}
|
| 30 | 30 |
b := p.AddBar(int64(total),
|
| 31 | 31 |
mpb.PrependDecorators(
|
| 32 | |
decor.Name(name, 0, decor.DwidthSync|decor.DidentRight),
|
|
32 |
decor.StaticName(name, 0, decor.DwidthSync|decor.DidentRight),
|
| 33 | 33 |
decor.ETA(4, decor.DSyncSpace),
|
| 34 | 34 |
),
|
| 35 | 35 |
mpb.AppendDecorators(
|
| 29 | 29 |
}
|
| 30 | 30 |
b := p.AddBar(int64(total),
|
| 31 | 31 |
mpb.PrependDecorators(
|
| 32 | |
decor.Name(name, 0, decor.DwidthSync|decor.DidentRight),
|
|
32 |
decor.StaticName(name, 0, decor.DwidthSync|decor.DidentRight),
|
| 33 | 33 |
decor.Elapsed(3, decor.DSyncSpace),
|
| 34 | 34 |
),
|
| 35 | 35 |
mpb.AppendDecorators(
|
| 29 | 29 |
}
|
| 30 | 30 |
b := p.AddBar(int64(total), mpb.BarID(i),
|
| 31 | 31 |
mpb.PrependDecorators(
|
| 32 | |
decor.Name(name, 0, decor.DwidthSync|decor.DidentRight),
|
|
32 |
decor.StaticName(name, 0, decor.DwidthSync|decor.DidentRight),
|
| 33 | 33 |
decor.ETA(4, decor.DSyncSpace),
|
| 34 | 34 |
),
|
| 35 | 35 |
mpb.AppendDecorators(
|
| 20 | 20 |
name := fmt.Sprintf("Bar#%d:", i)
|
| 21 | 21 |
bar := p.AddBar(int64(total),
|
| 22 | 22 |
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),
|
| 26 | 24 |
decor.Percentage(3, decor.DSyncSpace),
|
| 27 | 25 |
),
|
| 28 | 26 |
mpb.AppendDecorators(
|
| 29 | |
// ETA decorator, with no width sync
|
| 30 | 27 |
decor.ETA(2, 0),
|
| 31 | 28 |
),
|
| 32 | 29 |
)
|
| 48 | 48 |
}
|
| 49 | 49 |
b := p.AddBar(int64(total),
|
| 50 | 50 |
mpb.PrependDecorators(
|
| 51 | |
decor.Name(name, 0, decor.DwidthSync),
|
|
51 |
decor.StaticName(name, 0, decor.DwidthSync),
|
| 52 | 52 |
decor.Counters("%3s/%3s", 0, 10, decor.DSyncSpace),
|
| 53 | 53 |
),
|
| 54 | 54 |
mpb.AppendDecorators(
|
| 25 | 25 |
total := rand.Intn(120) + 10
|
| 26 | 26 |
bar := p.AddBar(int64(total),
|
| 27 | 27 |
mpb.PrependDecorators(
|
| 28 | |
decor.Name(name, len(name), 0),
|
|
28 |
decor.StaticName(name, len(name), 0),
|
| 29 | 29 |
decor.ETA(4, decor.DSyncSpace),
|
| 30 | 30 |
),
|
| 31 | 31 |
mpb.AppendDecorators(
|