Skip to content

Commit

Permalink
Merge pull request #1 from geek1011/refactor-devices
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaskin authored Nov 25, 2019
2 parents 9dba13c + dcc8686 commit 56ce949
Show file tree
Hide file tree
Showing 11 changed files with 717 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go
go:
- "1.10"
- "1.13"

script:
- make clean
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ clean:
rm -rfv build

deps:
go get github.com/tcnksm/ghr
go get github.com/mholt/archiver/cmd/arc
GO111MODULE=on go install github.com/tcnksm/ghr
GO111MODULE=on go install github.com/mholt/archiver/cmd/arc

test:
go test ./...
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# koboutils
Short utilities to do stuff with Kobo eReaders.
Utilities to do stuff with Kobo eReaders. Can be used as a library: godoc.org/github.com/geek1011/koboutils/v2/kobo.

Also can be used as a library: godoc.org/github.com/geek1011/koboutils/kobo
**Features:**
- Full support for device codenames (class, family, secondary).
- Device specs.
- Upgrade checks.
- Device detection.
- Cover image resizing.
- Firmware version and date extraction.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/geek1011/koboutils
module github.com/geek1011/koboutils/v2

go 1.12
go 1.13

require github.com/spf13/pflag v1.0.5
2 changes: 1 addition & 1 deletion kobo-find/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

"github.com/geek1011/koboutils/kobo"
"github.com/geek1011/koboutils/v2/kobo"
"github.com/spf13/pflag"
)

Expand Down
10 changes: 6 additions & 4 deletions kobo-info/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"time"

"github.com/geek1011/koboutils/kobo"
"github.com/geek1011/koboutils/v2/kobo"
"github.com/spf13/pflag"
)

Expand Down Expand Up @@ -56,9 +56,11 @@ func main() {
}

if device, ok := kobo.DeviceByID(id); ok {
printkv("Device", device.Name)
printkv("Device", device.Name())
printkv("Device ID", id)
printkv("Hardware", device.Hardware)
printkv("Device Family", fmt.Sprintf("%s (%s)", device.Family(), device.CodeNames().Family()))
printkv("Codenames", device.CodeNames().String())
printkv("Hardware", device.Hardware().String())
} else {
printkv("Device", "unknown")
printkv("Device ID", id)
Expand Down Expand Up @@ -96,7 +98,7 @@ func printkv(key, value string) {
}
fmt.Printf(` "%s": "%s"`, strings.Replace(strings.ToLower(key), " ", "_", -1), value)
} else {
fmt.Printf("%10s: %s\n", key, value)
fmt.Printf("%15s: %s\n", key, value)
}
}

Expand Down
Loading

0 comments on commit 56ce949

Please sign in to comment.