Progress when downloading single files and when parsing remote mirrors.

This commit is contained in:
Andrey Smirnov
2014-03-07 00:37:06 +04:00
parent 04d6603f38
commit 74c88f3ef6
5 changed files with 37 additions and 0 deletions
+7
View File
@@ -101,6 +101,13 @@ func (p *Progress) AddBar(count int) {
}
}
// SetBar sets current position for progress bar
func (p *Progress) SetBar(count int) {
if p.bar != nil {
p.bar.Set(count)
}
}
// Printf does printf but in safe manner: not overwriting progress bar
func (p *Progress) Printf(msg string, a ...interface{}) {
p.queue <- printTask{code: codePrint, message: fmt.Sprintf(msg, a...)}