fix scrolling progressbar bug

This commit is contained in:
Anand Babu (AB) Periasamy
2015-04-24 12:01:28 -07:00
parent c1f0409792
commit 409309442e
2 changed files with 9 additions and 14 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ func startBar(size int64) *pb.ProgressBar {
bar.ShowSpeed = true
bar.Callback = func(s string) {
// Colorize
console.Info("\r" + s)
console.Print("\r" + s)
}
// Feels like wget
bar.Format("[=> ]")
+8 -13
View File
@@ -37,15 +37,19 @@ var (
// currTheme is current theme
currThemeName = GetDefaultThemeName()
// Print prints a error message and exits
Print = themesDB[currThemeName].Info.Print
// Println prints a error message with a new line and exits
Println = themesDB[currThemeName].Info.Println
// Printf prints a error message with formatting and exits
Printf = themesDB[currThemeName].Info.Printf
// Fatal prints a error message and exits
Fatal = func(a ...interface{}) { print(themesDB[currThemeName].Fatal, a...); os.Exit(1) }
// Fatalln prints a error message with a new line and exits
Fatalln = func(a ...interface{}) { println(themesDB[currThemeName].Fatal, a...); os.Exit(1) }
// Fatalf prints a error message with formatting and exits
Fatalf = func(f string, a ...interface{}) {
printf(themesDB[currThemeName].Fatal, f, a...)
os.Exit(1)
}
Fatalf = func(f string, a ...interface{}) { printf(themesDB[currThemeName].Fatal, f, a...); os.Exit(1) }
// Error prints a error message
Error = func(a ...interface{}) { print(themesDB[currThemeName].Error, a...) }
@@ -122,11 +126,8 @@ var (
mutex.Unlock()
default:
mutex.Lock()
output := color.Output
color.Output = os.Stderr
c.Print(ProgramName() + ": ")
c.Print(a...)
color.Output = output
mutex.Unlock()
}
}
@@ -160,11 +161,8 @@ var (
mutex.Unlock()
default:
mutex.Lock()
output := color.Output
color.Output = os.Stderr
c.Print(ProgramName() + ": ")
c.Println(a...)
color.Output = output
mutex.Unlock()
}
}
@@ -198,11 +196,8 @@ var (
mutex.Unlock()
default:
mutex.Lock()
output := color.Output
color.Output = os.Stderr
c.Print(ProgramName() + ": ")
c.Printf(f, a...)
color.Output = output
mutex.Unlock()
}
}