diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/LICENSE b/Godeps/_workspace/src/github.com/cheggaaa/pb/LICENSE deleted file mode 100644 index 13ef3fe53..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012, Sergey Cherepanov -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/README.md b/Godeps/_workspace/src/github.com/cheggaaa/pb/README.md deleted file mode 100644 index af5c4bd50..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/README.md +++ /dev/null @@ -1,98 +0,0 @@ -## Terminal progress bar for Go - -Simple progress bar for console programms. - - -### Installation -``` -go get github.com/cheggaaa/pb -``` - -### Usage -```Go -package main - -import ( - "github.com/cheggaaa/pb" - "time" -) - -func main() { - count := 100000 - bar := pb.StartNew(count) - for i := 0; i < count; i++ { - bar.Increment() - time.Sleep(time.Millisecond) - } - bar.FinishPrint("The End!") -} -``` -Result will be like this: -``` -> go run test.go -37158 / 100000 [================>_______________________________] 37.16% 1m11s -``` - - -More functions? -```Go -// create bar -bar := pb.New(count) - -// refresh info every second (default 200ms) -bar.SetRefreshRate(time.Second) - -// show percents (by default already true) -bar.ShowPercent = true - -// show bar (by default already true) -bar.ShowBar = true - -// no need counters -bar.ShowCounters = false - -// show "time left" -bar.ShowTimeLeft = true - -// show average speed -bar.ShowSpeed = true - -// sets the width of the progress bar -bar.SetWidth(80) - -// sets the width of the progress bar, but if terminal size smaller will be ignored -bar.SetMaxWidth(80) - -// convert output to readable format (like KB, MB) -bar.SetUnits(pb.U_BYTES) - -// and start -bar.Start() -``` - -Want handle progress of io operations? -```Go -// create and start bar -bar := pb.New(myDataLen).SetUnits(pb.U_BYTES) -bar.Start() - -// my io.Reader -r := myReader - -// my io.Writer -w := myWriter - -// create multi writer -writer := io.MultiWriter(w, bar) - -// and copy -io.Copy(writer, r) - -// show example/copy/copy.go for advanced example - -``` - -Not like the looks? -```Go -bar.Format("<.- >") -``` diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/example/copy/copy.go b/Godeps/_workspace/src/github.com/cheggaaa/pb/example/copy/copy.go deleted file mode 100644 index 2576b1d16..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/example/copy/copy.go +++ /dev/null @@ -1,81 +0,0 @@ -package main - -import ( - "fmt" - "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/cheggaaa/pb" - "io" - "net/http" - "os" - "strconv" - "strings" - "time" -) - -func main() { - // check args - if len(os.Args) < 3 { - printUsage() - return - } - sourceName, destName := os.Args[1], os.Args[2] - - // check source - var source io.Reader - var sourceSize int64 - if strings.HasPrefix(sourceName, "http://") { - // open as url - resp, err := http.Get(sourceName) - if err != nil { - fmt.Printf("Can't get %s: %v\n", sourceName, err) - return - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - fmt.Printf("Server return non-200 status: %v\n", resp.Status) - return - } - i, _ := strconv.Atoi(resp.Header.Get("Content-Length")) - sourceSize = int64(i) - source = resp.Body - } else { - // open as file - s, err := os.Open(sourceName) - if err != nil { - fmt.Printf("Can't open %s: %v\n", sourceName, err) - return - } - defer s.Close() - // get source size - sourceStat, err := s.Stat() - if err != nil { - fmt.Printf("Can't stat %s: %v\n", sourceName, err) - return - } - sourceSize = sourceStat.Size() - source = s - } - - // create dest - dest, err := os.Create(destName) - if err != nil { - fmt.Printf("Can't create %s: %v\n", destName, err) - return - } - defer dest.Close() - - // create bar - bar := pb.New(int(sourceSize)).SetUnits(pb.U_BYTES).SetRefreshRate(time.Millisecond * 10) - bar.ShowSpeed = true - bar.Start() - - // create multi writer - writer := io.MultiWriter(dest, bar) - - // and copy - io.Copy(writer, source) - bar.Finish() -} - -func printUsage() { - fmt.Println("copy [source file or url] [dest file]") -} diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/example/pb.go b/Godeps/_workspace/src/github.com/cheggaaa/pb/example/pb.go deleted file mode 100644 index 659277d61..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/example/pb.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/cheggaaa/pb" - "time" -) - -func main() { - count := 5000 - bar := pb.New(count) - - // show percents (by default already true) - bar.ShowPercent = true - - // show bar (by default already true) - bar.ShowPercent = true - - // no need counters - bar.ShowCounters = true - - bar.ShowTimeLeft = true - - // and start - bar.Start() - for i := 0; i < count; i++ { - bar.Increment() - time.Sleep(time.Millisecond) - } - bar.FinishPrint("The End!") -} diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/format.go b/Godeps/_workspace/src/github.com/cheggaaa/pb/format.go deleted file mode 100644 index 1dd210be4..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/format.go +++ /dev/null @@ -1,45 +0,0 @@ -package pb - -import ( - "fmt" - "strconv" - "strings" -) - -type Units int - -const ( - // By default, without type handle - U_NO Units = iota - // Handle as b, Kb, Mb, etc - U_BYTES -) - -// Format integer -func Format(i int64, units Units) string { - switch units { - case U_BYTES: - return FormatBytes(i) - default: - // by default just convert to string - return strconv.FormatInt(i, 10) - } -} - -// Convert bytes to human readable string. Like a 2 MB, 64.2 KB, 52 B -func FormatBytes(i int64) (result string) { - switch { - case i > (1024 * 1024 * 1024 * 1024): - result = fmt.Sprintf("%#.02f TB", float64(i)/1024/1024/1024/1024) - case i > (1024 * 1024 * 1024): - result = fmt.Sprintf("%#.02f GB", float64(i)/1024/1024/1024) - case i > (1024 * 1024): - result = fmt.Sprintf("%#.02f MB", float64(i)/1024/1024) - case i > 1024: - result = fmt.Sprintf("%#.02f KB", float64(i)/1024) - default: - result = fmt.Sprintf("%d B", i) - } - result = strings.Trim(result, " ") - return -} diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/format_test.go b/Godeps/_workspace/src/github.com/cheggaaa/pb/format_test.go deleted file mode 100644 index b76275e29..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/format_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package pb - -import ( - "fmt" - "strconv" - "testing" -) - -func Test_DefaultsToInteger(t *testing.T) { - value := int64(1000) - expected := strconv.Itoa(int(value)) - actual := Format(value, -1) - - if actual != expected { - t.Error(fmt.Sprintf("Expected {%s} was {%s}", expected, actual)) - } -} - -func Test_CanFormatAsInteger(t *testing.T) { - value := int64(1000) - expected := strconv.Itoa(int(value)) - actual := Format(value, U_NO) - - if actual != expected { - t.Error(fmt.Sprintf("Expected {%s} was {%s}", expected, actual)) - } -} - -func Test_CanFormatAsBytes(t *testing.T) { - value := int64(1000) - expected := "1000 B" - actual := Format(value, U_BYTES) - - if actual != expected { - t.Error(fmt.Sprintf("Expected {%s} was {%s}", expected, actual)) - } -} diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb.go b/Godeps/_workspace/src/github.com/cheggaaa/pb/pb.go deleted file mode 100644 index 02303ee82..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb.go +++ /dev/null @@ -1,352 +0,0 @@ -package pb - -import ( - "fmt" - "io" - "math" - "strings" - "sync" - "sync/atomic" - "time" -) - -const ( - // Default refresh rate - 200ms - DEFAULT_REFRESH_RATE = time.Millisecond * 200 - FORMAT = "[=>-]" -) - -// DEPRECATED -// variables for backward compatibility, from now do not work -// use pb.Format and pb.SetRefreshRate -var ( - DefaultRefreshRate = DEFAULT_REFRESH_RATE - BarStart, BarEnd, Empty, Current, CurrentN string -) - -// Create new progress bar object -func New(total int) *ProgressBar { - return New64(int64(total)) -} - -// Create new progress bar object uding int64 as total -func New64(total int64) *ProgressBar { - pb := &ProgressBar{ - Total: total, - RefreshRate: DEFAULT_REFRESH_RATE, - ShowPercent: true, - ShowCounters: true, - ShowBar: true, - ShowTimeLeft: true, - ShowFinalTime: true, - Units: U_NO, - ManualUpdate: false, - isFinish: make(chan struct{}), - currentValue: -1, - } - return pb.Format(FORMAT) -} - -// Create new object and start -func StartNew(total int) *ProgressBar { - return New(total).Start() -} - -// Callback for custom output -// For example: -// bar.Callback = func(s string) { -// mySuperPrint(s) -// } -// -type Callback func(out string) - -type ProgressBar struct { - current int64 // current must be first member of struct (https://code.google.com/p/go/issues/detail?id=5278) - - Total int64 - RefreshRate time.Duration - ShowPercent, ShowCounters bool - ShowSpeed, ShowTimeLeft, ShowBar bool - ShowFinalTime bool - Output io.Writer - Callback Callback - NotPrint bool - Units Units - Width int - ForceWidth bool - ManualUpdate bool - - finishOnce sync.Once //Guards isFinish - isFinish chan struct{} - - startTime time.Time - startValue int64 - currentValue int64 - - prefix, postfix string - - BarStart string - BarEnd string - Empty string - Current string - CurrentN string -} - -// Start print -func (pb *ProgressBar) Start() *ProgressBar { - pb.startTime = time.Now() - pb.startValue = pb.current - if pb.Total == 0 { - pb.ShowBar = false - pb.ShowTimeLeft = false - pb.ShowPercent = false - } - if !pb.ManualUpdate { - go pb.writer() - } - return pb -} - -// Increment current value -func (pb *ProgressBar) Increment() int { - return pb.Add(1) -} - -// Set current value -func (pb *ProgressBar) Set(current int) *ProgressBar { - return pb.Set64(int64(current)) -} - -// Set64 sets the current value as int64 -func (pb *ProgressBar) Set64(current int64) *ProgressBar { - atomic.StoreInt64(&pb.current, current) - return pb -} - -// Add to current value -func (pb *ProgressBar) Add(add int) int { - return int(pb.Add64(int64(add))) -} - -func (pb *ProgressBar) Add64(add int64) int64 { - return atomic.AddInt64(&pb.current, add) -} - -// Set prefix string -func (pb *ProgressBar) Prefix(prefix string) *ProgressBar { - pb.prefix = prefix - return pb -} - -// Set postfix string -func (pb *ProgressBar) Postfix(postfix string) *ProgressBar { - pb.postfix = postfix - return pb -} - -// Set custom format for bar -// EXAMPLE: bar.Format("[=>_]") -func (pb *ProgressBar) Format(format string) *ProgressBar { - formatEntries := strings.Split(format, "") - if len(formatEntries) == 5 { - pb.BarStart = formatEntries[0] - pb.BarEnd = formatEntries[4] - pb.Empty = formatEntries[3] - pb.Current = formatEntries[1] - pb.CurrentN = formatEntries[2] - } - return pb -} - -// Set bar refresh rate -func (pb *ProgressBar) SetRefreshRate(rate time.Duration) *ProgressBar { - pb.RefreshRate = rate - return pb -} - -// Set units -// bar.SetUnits(U_NO) - by default -// bar.SetUnits(U_BYTES) - for Mb, Kb, etc -func (pb *ProgressBar) SetUnits(units Units) *ProgressBar { - pb.Units = units - return pb -} - -// Set max width, if width is bigger than terminal width, will be ignored -func (pb *ProgressBar) SetMaxWidth(width int) *ProgressBar { - pb.Width = width - pb.ForceWidth = false - return pb -} - -// Set bar width -func (pb *ProgressBar) SetWidth(width int) *ProgressBar { - pb.Width = width - pb.ForceWidth = true - return pb -} - -// End print -func (pb *ProgressBar) Finish() { - //Protect multiple calls - pb.finishOnce.Do(func() { - close(pb.isFinish) - pb.write(atomic.LoadInt64(&pb.current)) - if !pb.NotPrint { - fmt.Println() - } - }) -} - -// End print and write string 'str' -func (pb *ProgressBar) FinishPrint(str string) { - pb.Finish() - fmt.Println(str) -} - -// implement io.Writer -func (pb *ProgressBar) Write(p []byte) (n int, err error) { - n = len(p) - pb.Add(n) - return -} - -// implement io.Reader -func (pb *ProgressBar) Read(p []byte) (n int, err error) { - n = len(p) - pb.Add(n) - return -} - -// Create new proxy reader over bar -func (pb *ProgressBar) NewProxyReader(r io.Reader) *Reader { - return &Reader{r, pb} -} - -func (pb *ProgressBar) write(current int64) { - width := pb.getWidth() - - var percentBox, countersBox, timeLeftBox, speedBox, barBox, end, out string - - // percents - if pb.ShowPercent { - percent := float64(current) / (float64(pb.Total) / float64(100)) - percentBox = fmt.Sprintf(" %#.02f %% ", percent) - } - - // counters - if pb.ShowCounters { - if pb.Total > 0 { - countersBox = fmt.Sprintf("%s / %s ", Format(current, pb.Units), Format(pb.Total, pb.Units)) - } else { - countersBox = Format(current, pb.Units) + " " - } - } - - // time left - fromStart := time.Now().Sub(pb.startTime) - currentFromStart := current - pb.startValue - select { - case <-pb.isFinish: - if pb.ShowFinalTime { - left := (fromStart / time.Second) * time.Second - timeLeftBox = left.String() - } - default: - if pb.ShowTimeLeft && currentFromStart > 0 { - perEntry := fromStart / time.Duration(currentFromStart) - left := time.Duration(pb.Total-currentFromStart) * perEntry - left = (left / time.Second) * time.Second - timeLeftBox = left.String() - } - } - - // speed - if pb.ShowSpeed && currentFromStart > 0 { - fromStart := time.Now().Sub(pb.startTime) - speed := float64(currentFromStart) / (float64(fromStart) / float64(time.Second)) - speedBox = Format(int64(speed), pb.Units) + "/s " - } - - // bar - if pb.ShowBar { - size := width - len(countersBox+pb.BarStart+pb.BarEnd+percentBox+timeLeftBox+speedBox+pb.prefix+pb.postfix) - if size > 0 && pb.Total > 0 { - curCount := int(math.Ceil((float64(current) / float64(pb.Total)) * float64(size))) - emptCount := size - curCount - barBox = pb.BarStart - if emptCount < 0 { - emptCount = 0 - } - if curCount > size { - curCount = size - } - if emptCount <= 0 { - barBox += strings.Repeat(pb.Current, curCount) - } else if curCount > 0 { - barBox += strings.Repeat(pb.Current, curCount-1) + pb.CurrentN - } - - barBox += strings.Repeat(pb.Empty, emptCount) + pb.BarEnd - } - } - - // check len - out = pb.prefix + countersBox + barBox + percentBox + speedBox + timeLeftBox + pb.postfix - if len(out) < width { - end = strings.Repeat(" ", width-len(out)) - } - - // and print! - switch { - case pb.Output != nil: - fmt.Fprint(pb.Output, "\r"+out+end) - case pb.Callback != nil: - pb.Callback(out + end) - case !pb.NotPrint: - fmt.Print("\r" + out + end) - } -} - -func (pb *ProgressBar) getWidth() int { - if pb.ForceWidth { - return pb.Width - } - - width := pb.Width - termWidth, _ := terminalWidth() - if width == 0 || termWidth <= width { - width = termWidth - } - - return width -} - -// Write the current state of the progressbar -func (pb *ProgressBar) Update() { - c := atomic.LoadInt64(&pb.current) - if c != pb.currentValue { - pb.write(c) - pb.currentValue = c - } -} - -// Internal loop for writing progressbar -func (pb *ProgressBar) writer() { - pb.Update() - for { - select { - case <-pb.isFinish: - return - case <-time.After(pb.RefreshRate): - pb.Update() - } - } -} - -type window struct { - Row uint16 - Col uint16 - Xpixel uint16 - Ypixel uint16 -} diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_nix.go b/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_nix.go deleted file mode 100644 index 5db4e523f..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_nix.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build linux darwin freebsd netbsd openbsd - -package pb - -import "syscall" - -const sys_ioctl = syscall.SYS_IOCTL diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_solaris.go b/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_solaris.go deleted file mode 100644 index 00d705e35..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_solaris.go +++ /dev/null @@ -1,5 +0,0 @@ -// +build solaris - -package pb - -const sys_ioctl = 54 diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_test.go b/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_test.go deleted file mode 100644 index dfe394fd4..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package pb - -import ( - "testing" -) - -func Test_IncrementAddsOne(t *testing.T) { - count := 5000 - bar := New(count) - expected := 1 - actual := bar.Increment() - - if actual != expected { - t.Errorf("Expected {%d} was {%d}", expected, actual) - } -} - -func Test_Width(t *testing.T) { - count := 5000 - bar := New(count) - width := 100 - bar.SetWidth(100).Callback = func(out string) { - if len(out) != width { - t.Errorf("Bar width expected {%d} was {%d}", len(out), width) - } - } - bar.Start() - bar.Increment() - bar.Finish() -} - -func Test_MultipleFinish(t *testing.T) { - bar := New(5000) - bar.Add(2000) - bar.Finish() - bar.Finish() -} diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_win.go b/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_win.go deleted file mode 100644 index 719d39bf2..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_win.go +++ /dev/null @@ -1,16 +0,0 @@ -// +build windows - -package pb - -import ( - "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/olekukonko/ts" -) - -func bold(str string) string { - return str -} - -func terminalWidth() (int, error) { - size, err := ts.GetSize() - return size.Col(), err -} diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_x.go b/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_x.go deleted file mode 100644 index dd5f906e1..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/pb_x.go +++ /dev/null @@ -1,46 +0,0 @@ -// +build linux darwin freebsd netbsd openbsd solaris - -package pb - -import ( - "os" - "runtime" - "syscall" - "unsafe" -) - -const ( - TIOCGWINSZ = 0x5413 - TIOCGWINSZ_OSX = 1074295912 -) - -var tty *os.File - -func init() { - var err error - tty, err = os.Open("/dev/tty") - if err != nil { - tty = os.Stdin - } -} - -func bold(str string) string { - return "\033[1m" + str + "\033[0m" -} - -func terminalWidth() (int, error) { - w := new(window) - tio := syscall.TIOCGWINSZ - if runtime.GOOS == "darwin" { - tio = TIOCGWINSZ_OSX - } - res, _, err := syscall.Syscall(sys_ioctl, - tty.Fd(), - uintptr(tio), - uintptr(unsafe.Pointer(w)), - ) - if int(res) == -1 { - return 0, err - } - return int(w.Col), nil -} diff --git a/Godeps/_workspace/src/github.com/cheggaaa/pb/reader.go b/Godeps/_workspace/src/github.com/cheggaaa/pb/reader.go deleted file mode 100644 index 2d01125ca..000000000 --- a/Godeps/_workspace/src/github.com/cheggaaa/pb/reader.go +++ /dev/null @@ -1,17 +0,0 @@ -package pb - -import ( - "io" -) - -// It's proxy reader, implement io.Reader -type Reader struct { - io.Reader - bar *ProgressBar -} - -func (r *Reader) Read(p []byte) (n int, err error) { - n, err = r.Reader.Read(p) - r.bar.Add(n) - return -} diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/.travis.yml b/Godeps/_workspace/src/github.com/olekukonko/ts/.travis.yml deleted file mode 100644 index e53b2de38..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: go - -go: - - 1.1 - - 1.2 - - tip \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/LICENCE b/Godeps/_workspace/src/github.com/olekukonko/ts/LICENCE deleted file mode 100644 index 1fd848425..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2014 by Oleku Konko - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/README.md b/Godeps/_workspace/src/github.com/olekukonko/ts/README.md deleted file mode 100644 index 4e1598b1c..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/README.md +++ /dev/null @@ -1,28 +0,0 @@ -ts (Terminal Size) -== - -[![Build Status](https://travis-ci.org/olekukonko/ts.png?branch=master)](https://travis-ci.org/olekukonko/ts) [![Total views](https://sourcegraph.com/api/repos/github.com/olekukonko/ts/counters/views.png)](https://sourcegraph.com/github.com/olekukonko/ts) - -Simple go Application to get Terminal Size. So Many Implementations do not support windows but `ts` has full windows support. -Run `go get github.com/olekukonko/ts` to download and install - -#### Example - -```go -package main - -import ( - "fmt" - "github.com/olekukonko/ts" -) - -func main() { - size, _ := ts.GetSize() - fmt.Println(size.Col()) // Get Width - fmt.Println(size.Row()) // Get Height - fmt.Println(size.PosX()) // Get X position - fmt.Println(size.PosY()) // Get Y position -} -``` - -[See Documentation](http://godoc.org/github.com/olekukonko/ts) diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/doc.go b/Godeps/_workspace/src/github.com/olekukonko/ts/doc.go deleted file mode 100644 index 50c63cae0..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/doc.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Terminal API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - -/** - -Simple go Application to get Terminal Size. So Many Implementations do not support windows but `ts` has full windows support. -Run `go get github.com/olekukonko/ts` to download and install - -Installation - -Minimum requirements are Go 1.1+ with fill Windows support - -Example - - package main - - import ( - "fmt" - "github.com/olekukonko/ts" - ) - - func main() { - size, _ := ts.GetSize() - fmt.Println(size.Col()) // Get Width - fmt.Println(size.Row()) // Get Height - fmt.Println(size.PosX()) // Get X position - fmt.Println(size.PosY()) // Get Y position - } - -**/ - -package ts diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/ts.go b/Godeps/_workspace/src/github.com/olekukonko/ts/ts.go deleted file mode 100644 index 35fdf7427..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/ts.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Terminal API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - -package ts - -// Return System Size -type Size struct { - row uint16 - col uint16 - posX uint16 - posY uint16 -} - -// Get Terminal Width -func (w Size) Col() int { - return int(w.col) -} - -// Get Terminal Height -func (w Size) Row() int { - return int(w.row) -} - -// Get Position X -func (w Size) PosX() int { - return int(w.posX) -} - -// Get Position Y -func (w Size) PosY() int { - return int(w.posY) -} diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_darwin.go b/Godeps/_workspace/src/github.com/olekukonko/ts/ts_darwin.go deleted file mode 100644 index bdcf42b47..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_darwin.go +++ /dev/null @@ -1,14 +0,0 @@ -// +build darwin - -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Terminal API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - -package ts - -const ( - TIOCGWINSZ = 0x40087468 -) diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_linux.go b/Godeps/_workspace/src/github.com/olekukonko/ts/ts_linux.go deleted file mode 100644 index ee2db6d47..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_linux.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build linux - -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Terminal API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems -package ts - -const ( - TIOCGWINSZ = 0x5413 -) diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_other.go b/Godeps/_workspace/src/github.com/olekukonko/ts/ts_other.go deleted file mode 100644 index bf8048192..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_other.go +++ /dev/null @@ -1,14 +0,0 @@ -// +build !windows,!darwin,!freebsd,!netbsd,!openbsd,!linux - -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Terminal API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - -package ts - -const ( - TIOCGWINSZ = 0 -) diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_test.go b/Godeps/_workspace/src/github.com/olekukonko/ts/ts_test.go deleted file mode 100644 index 4998e7c01..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_test.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Terminal API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - -package ts - -import ( - "fmt" - "testing" -) - -func ExampleGetSize() { - size, _ := GetSize() - fmt.Println(size.Col()) // Get Width - fmt.Println(size.Row()) // Get Height - fmt.Println(size.PosX()) // Get X position - fmt.Println(size.PosY()) // Get Y position -} - -func TestSize(t *testing.T) { - size, err := GetSize() - - if err != nil { - t.Fatal(err) - } - if size.Col() == 0 || size.Row() == 0 { - t.Fatalf("Screen Size Failed") - } -} diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_unix.go b/Godeps/_workspace/src/github.com/olekukonko/ts/ts_unix.go deleted file mode 100644 index 8728b614c..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_unix.go +++ /dev/null @@ -1,14 +0,0 @@ -// +build freebsd netbsd openbsd - -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Terminal API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - -package ts - -const ( - TIOCGWINSZ = 0x40087468 -) diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_windows.go b/Godeps/_workspace/src/github.com/olekukonko/ts/ts_windows.go deleted file mode 100644 index 2f34d5699..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_windows.go +++ /dev/null @@ -1,64 +0,0 @@ -// +build windows - -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Terminal API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - -package ts - -import ( - "syscall" - "unsafe" -) - -var ( - kernel32 = syscall.NewLazyDLL("kernel32.dll") - - // Retrieves information about the specified console screen buffer. - // See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683171(v=vs.85).aspx - screenBufferInfo = kernel32.NewProc("GetConsoleScreenBufferInfo") -) - -// Contains information about a console screen buffer. -// http://msdn.microsoft.com/en-us/library/windows/desktop/ms682093(v=vs.85).aspx -type CONSOLE_SCREEN_BUFFER_INFO struct { - DwSize COORD - DwCursorPosition COORD - WAttributes uint16 - SrWindow SMALL_RECT - DwMaximumWindowSize COORD -} - -// Defines the coordinates of a character cell in a console screen buffer. -// The origin of the coordinate system (0,0) is at the top, left cell of the buffer. -// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms682119(v=vs.85).aspx -type COORD struct { - X, Y uint16 -} - -// Defines the coordinates of the upper left and lower right corners of a rectangle. -// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms686311(v=vs.85).aspx -type SMALL_RECT struct { - Left, Top, Right, Bottom uint16 -} - -func GetSize() (ws Size, err error) { - var info CONSOLE_SCREEN_BUFFER_INFO - rc, _, err := screenBufferInfo.Call( - uintptr(syscall.Stdout), - uintptr(unsafe.Pointer(&info))) - - if rc == 0 { - return ws, err - } - - ws = Size{info.SrWindow.Bottom, - info.SrWindow.Right, - info.DwCursorPosition.X, - info.DwCursorPosition.Y} - - return ws, nil -} diff --git a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_x.go b/Godeps/_workspace/src/github.com/olekukonko/ts/ts_x.go deleted file mode 100644 index 1b260e381..000000000 --- a/Godeps/_workspace/src/github.com/olekukonko/ts/ts_x.go +++ /dev/null @@ -1,46 +0,0 @@ -// +build !windows - -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Terminal API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - -package ts - -import ( - "syscall" - "unsafe" -) - -// Get Windows Size -func GetSize() (ws Size, err error) { - _, _, ec := syscall.Syscall(syscall.SYS_IOCTL, - uintptr(syscall.Stdout), - uintptr(TIOCGWINSZ), - uintptr(unsafe.Pointer(&ws))) - - err = getError(ec) - - if TIOCGWINSZ == 0 && err != nil { - ws = Size{80, 25, 0, 0} - } - return ws, err -} - -func getError(ec interface{}) (err error) { - switch v := ec.(type) { - - case syscall.Errno: // Some implementation return syscall.Errno number - if v != 0 { - err = syscall.Errno(v) - } - - case error: // Some implementation return error - err = ec.(error) - default: - err = nil - } - return -} diff --git a/core/commands/add.go b/core/commands/add.go index b0a31c064..c6fc7146e 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -4,8 +4,8 @@ import ( "fmt" "io" - "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/cheggaaa/pb" "github.com/ipfs/go-ipfs/core/coreunix" + "gx/ipfs/QmeWjRodbcZFKe5tMN7poEx3izym6osrLSnTLf9UjJZBbs/pb" cmds "github.com/ipfs/go-ipfs/commands" files "github.com/ipfs/go-ipfs/commands/files" diff --git a/core/commands/get.go b/core/commands/get.go index 08c76121e..7417d5c7b 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -9,7 +9,7 @@ import ( gopath "path" "strings" - "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/cheggaaa/pb" + "gx/ipfs/QmeWjRodbcZFKe5tMN7poEx3izym6osrLSnTLf9UjJZBbs/pb" cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" diff --git a/package.json b/package.json index b12a43f04..bf19f69f8 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,12 @@ "hash": "QmYnf27kzqR2cxt6LFZdrAFJuQd6785fTkBvMuEj9EeRxM", "name": "proquint", "version": "0.0.0" + }, + { + "author": "cheggaaa", + "hash": "QmeWjRodbcZFKe5tMN7poEx3izym6osrLSnTLf9UjJZBbs", + "name": "pb", + "version": "1.0.3" } ], "gxVersion": "0.4.0",