diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..de441e7 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +golang-github-vbauerster-mpb (3.3.4-1) UNRELEASED; urgency=medium + + * Initial release (Closes: TODO) + + -- Reinhard Tartler Tue, 19 Mar 2019 19:33:51 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b4de394 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..f04c53b --- /dev/null +++ b/debian/control @@ -0,0 +1,98 @@ +Source: golang-github-vbauerster-mpb +Section: devel +Priority: optional +Maintainer: Debian Go Packaging Team +Uploaders: Reinhard Tartler +Build-Depends: debhelper (>= 11), + dh-golang, + golang-any, + golang-github-mattn-go-isatty-dev, + golang-github-vividcortex-ewma-dev, + golang-golang-x-crypto-dev +Standards-Version: 4.2.1 +Homepage: https://github.com/vbauerster/mpb +Vcs-Browser: https://salsa.debian.org/go-team/packages/golang-github-vbauerster-mpb +Vcs-Git: https://salsa.debian.org/go-team/packages/golang-github-vbauerster-mpb.git +XS-Go-Import-Path: github.com/vbauerster/mpb +Testsuite: autopkgtest-pkg-go + +Package: golang-github-vbauerster-mpb-dev +Architecture: all +Depends: ${misc:Depends}, + golang-github-mattn-go-isatty-dev, + golang-github-vividcortex-ewma-dev, + golang-golang-x-crypto-dev +Description: multi progress bar for Go cli applications + Multi Progress Bar GoDoc (https://godoc.org/github.com/vbauerster/mpb) + Build Status (https://travis-ci.org/vbauerster/mpb) Go Report Card + (https://goreportcard.com/report/github.com/vbauerster/mpb) + . + mpb is a Go lib for rendering progress bars in terminal applications. + Features• Multiple Bars: Multiple progress bars are supported• + Dynamic Total: Set total while bar is running• Dynamic Add/Remove: + Dynamically add or remove bars• Cancellation: Cancel whole + rendering process• Predefined Decorators: Elapsed time, ewma + (https://github.com/VividCortex/ewma) based ETA, Percentage, Bytes + counter• Decorator's width sync: Synchronized decorator's width among + multiple barsUsageRendering single bar (_examples/singleBar/main.go) + ```go package main + . + import ( + "math/rand" "time" + "github.com/vbauerster/mpb/v4" "github.com/vbauerster/mpb/v4/decor" + . + ) + . + func main() { + // initialize progress container, with custom width p := + mpb.New(mpb.WithWidth(64)) + total := 100 name := "Single Bar:" // adding a single bar, which will + inherit container's width bar := p.AddBar(int64(total), + // set custom bar style, default one is "[=>-]" + mpb.BarStyle("╢▌▌░╟"), mpb.PrependDecorators( + // display our name with one space on the right decor.Name(name, + decor.WC{W: len(name) + 1, C: decor.DidentRight}), // replace ETA + decorator with "done" message, OnComplete event decor.OnComplete( + // ETA decorator with ewma age of 60, and width reservation + of 4 decor.EwmaETA(decor.ET_STYLE_GO, 60, decor.WC{W: 4}), + "done", + ), + ), mpb.AppendDecorators(decor.Percentage()), + ) // simulating some work max := 100 * time.Millisecond for i := 0; i < + total; i++ { + start := time.Now() time.Sleep(time.Duration(rand.Intn(10)+1) * + max / 10) // ewma based decorators require work duration measurement + bar.IncrBy(1, time.Since(start)) + } // wait for our bar to complete and flush p.Wait() + . + } ``` Rendering multiple bars (_examples/multiBars//main.go) ```go + var wg sync.WaitGroup // pass &wg (optional), so p will wait for it + eventually p := mpb.New(mpb.WithWaitGroup(&wg)) total, numBars := + 100, 3 wg.Add(numBars) + for i := 0; i < numBars; i++ { + name := fmt.Sprintf("Bar#%d:", i) bar := p.AddBar(int64(total), + mpb.PrependDecorators( + // simple name decorator decor.Name(name), // + decor.DSyncWidth bit enables column width synchronization + decor.Percentage(decor.WCSyncSpace), + ), mpb.AppendDecorators( + // replace ETA decorator with "done" message, OnComplete + event decor.OnComplete( + // ETA decorator with ewma age of 60 + decor.EwmaETA(decor.ET_STYLE_GO, 60), "done", + ), + ), + ) // simulating some work go func() { + defer wg.Done() max := 100 * time.Millisecond for i := 0; i < + total; i++ { + start := time.Now() time.Sleep(time.Duration(rand.Intn(10)+1) + * max / 10) // ewma based decorators require work duration + measurement bar.IncrBy(1, time.Since(start)) + } + }() + } // Waiting for passed &wg and for all bars to complete and flush + p.Wait() + . + ``` Dynamic total (_examples/dynTotal/main.go) dynamic total + Complex example (_examples/complex/main.go) complex Bytes counters + (_examples/io/main.go) byte counters diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..34012c8 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,17 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: mpb +Source: https://github.com/vbauerster/mpb +Files-Excluded: + Godeps/_workspace + +Files: * +Copyright: 2016 Vladimir Bauer +License: BSD-3-clause + +Files: debian/* +Copyright: 2019 Reinhard Tartler +License: BSD-3-clause +Comment: Debian packaging is licensed under the same terms as upstream + +License: BSD-3-clause +TODO \ No newline at end of file diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..cec628c --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,2 @@ +[DEFAULT] +pristine-tar = True diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..8cce5e0 --- /dev/null +++ b/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ --buildsystem=golang --with=golang diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..fce75e7 --- /dev/null +++ b/debian/watch @@ -0,0 +1,4 @@ +version=4 +opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/golang-github-vbauerster-mpb-\$1\.tar\.gz/,\ +uversionmangle=s/(\d)[_\.\-\+]?(RC|rc|pre|dev|beta|alpha)[.]?(\d*)$/\$1~\$2\$3/ \ + https://github.com/vbauerster/mpb/tags .*/v?(\d\S*)\.tar\.gz