Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor devices, add cover size stuff #1

Merged
merged 15 commits into from
Nov 25, 2019
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