Codebase list golang-github-vbauerster-mpb / 73b92cc
generated packaging Reinhard Tartler 7 years ago
8 changed file(s) with 132 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 golang-github-vbauerster-mpb (3.3.4-1) UNRELEASED; urgency=medium
1
2 * Initial release (Closes: TODO)
3
4 -- Reinhard Tartler <siretart@tauware.de> Tue, 19 Mar 2019 19:33:51 -0400
0 Source: golang-github-vbauerster-mpb
1 Section: devel
2 Priority: optional
3 Maintainer: Debian Go Packaging Team <team+pkg-go@tracker.debian.org>
4 Uploaders: Reinhard Tartler <siretart@tauware.de>
5 Build-Depends: debhelper (>= 11),
6 dh-golang,
7 golang-any,
8 golang-github-mattn-go-isatty-dev,
9 golang-github-vividcortex-ewma-dev,
10 golang-golang-x-crypto-dev
11 Standards-Version: 4.2.1
12 Homepage: https://github.com/vbauerster/mpb
13 Vcs-Browser: https://salsa.debian.org/go-team/packages/golang-github-vbauerster-mpb
14 Vcs-Git: https://salsa.debian.org/go-team/packages/golang-github-vbauerster-mpb.git
15 XS-Go-Import-Path: github.com/vbauerster/mpb
16 Testsuite: autopkgtest-pkg-go
17
18 Package: golang-github-vbauerster-mpb-dev
19 Architecture: all
20 Depends: ${misc:Depends},
21 golang-github-mattn-go-isatty-dev,
22 golang-github-vividcortex-ewma-dev,
23 golang-golang-x-crypto-dev
24 Description: multi progress bar for Go cli applications
25 Multi Progress Bar GoDoc (https://godoc.org/github.com/vbauerster/mpb)
26 Build Status (https://travis-ci.org/vbauerster/mpb) Go Report Card
27 (https://goreportcard.com/report/github.com/vbauerster/mpb)
28 .
29 mpb is a Go lib for rendering progress bars in terminal applications.
30 Features• Multiple Bars: Multiple progress bars are supported•
31 Dynamic Total: Set total while bar is running• Dynamic Add/Remove:
32 Dynamically add or remove bars• Cancellation: Cancel whole
33 rendering process• Predefined Decorators: Elapsed time, ewma
34 (https://github.com/VividCortex/ewma) based ETA, Percentage, Bytes
35 counter• Decorator's width sync: Synchronized decorator's width among
36 multiple barsUsageRendering single bar (_examples/singleBar/main.go)
37 ```go package main
38 .
39 import (
40 "math/rand" "time"
41 "github.com/vbauerster/mpb/v4" "github.com/vbauerster/mpb/v4/decor"
42 .
43 )
44 .
45 func main() {
46 // initialize progress container, with custom width p :=
47 mpb.New(mpb.WithWidth(64))
48 total := 100 name := "Single Bar:" // adding a single bar, which will
49 inherit container's width bar := p.AddBar(int64(total),
50 // set custom bar style, default one is "[=>-]"
51 mpb.BarStyle("╢▌▌░╟"), mpb.PrependDecorators(
52 // display our name with one space on the right decor.Name(name,
53 decor.WC{W: len(name) + 1, C: decor.DidentRight}), // replace ETA
54 decorator with "done" message, OnComplete event decor.OnComplete(
55 // ETA decorator with ewma age of 60, and width reservation
56 of 4 decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WC{W: 4}),
57 "done",
58 ),
59 ), mpb.AppendDecorators(decor.Percentage()),
60 ) // simulating some work max := 100 * time.Millisecond for i := 0; i <
61 total; i++ {
62 start := time.Now() time.Sleep(time.Duration(rand.Intn(10)+1) *
63 max / 10) // ewma based decorators require work duration measurement
64 bar.IncrBy(1, time.Since(start))
65 } // wait for our bar to complete and flush p.Wait()
66 .
67 } ``` Rendering multiple bars (_examples/multiBars//main.go) ```go
68 var wg sync.WaitGroup // pass &wg (optional), so p will wait for it
69 eventually p := mpb.New(mpb.WithWaitGroup(&wg)) total, numBars :=
70 100, 3 wg.Add(numBars)
71 for i := 0; i < numBars; i++ {
72 name := fmt.Sprintf("Bar#%d:", i) bar := p.AddBar(int64(total),
73 mpb.PrependDecorators(
74 // simple name decorator decor.Name(name), //
75 decor.DSyncWidth bit enables column width synchronization
76 decor.Percentage(decor.WCSyncSpace),
77 ), mpb.AppendDecorators(
78 // replace ETA decorator with "done" message, OnComplete
79 event decor.OnComplete(
80 // ETA decorator with ewma age of 60
81 decor.EwmaETA(decor.ET_STYLE_GO, 60), "done",
82 ),
83 ),
84 ) // simulating some work go func() {
85 defer wg.Done() max := 100 * time.Millisecond for i := 0; i <
86 total; i++ {
87 start := time.Now() time.Sleep(time.Duration(rand.Intn(10)+1)
88 * max / 10) // ewma based decorators require work duration
89 measurement bar.IncrBy(1, time.Since(start))
90 }
91 }()
92 } // Waiting for passed &wg and for all bars to complete and flush
93 p.Wait()
94 .
95 ``` Dynamic total (_examples/dynTotal/main.go) dynamic total
96 Complex example (_examples/complex/main.go) complex Bytes counters
97 (_examples/io/main.go) byte counters
0 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
1 Upstream-Name: mpb
2 Source: https://github.com/vbauerster/mpb
3 Files-Excluded:
4 Godeps/_workspace
5
6 Files: *
7 Copyright: 2016 Vladimir Bauer
8 License: BSD-3-clause
9
10 Files: debian/*
11 Copyright: 2019 Reinhard Tartler <siretart@tauware.de>
12 License: BSD-3-clause
13 Comment: Debian packaging is licensed under the same terms as upstream
14
15 License: BSD-3-clause
16 TODO
0 [DEFAULT]
1 pristine-tar = True
0 #!/usr/bin/make -f
1
2 %:
3 dh $@ --buildsystem=golang --with=golang
0 3.0 (quilt)
0 version=4
1 opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/golang-github-vbauerster-mpb-\$1\.tar\.gz/,\
2 uversionmangle=s/(\d)[_\.\-\+]?(RC|rc|pre|dev|beta|alpha)[.]?(\d*)$/\$1~\$2\$3/ \
3 https://github.com/vbauerster/mpb/tags .*/v?(\d\S*)\.tar\.gz