1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

wtf.Position into its own file

This commit is contained in:
Chris Cummer 2018-04-08 05:04:33 -07:00 committed by Chris Cummer
parent b216005385
commit 01aab4cc53
5 changed files with 36 additions and 37 deletions

View File

@ -1,7 +1,7 @@
wtf: wtf:
refreshInterval: 1 refreshInterval: 1
bamboohr: bamboohr:
enabled: true enabled: false
position: position:
top: 0 top: 0
left: 0 left: 0
@ -11,7 +11,7 @@ wtf:
url: "https://api.bamboohr.com/api/gateway.php" url: "https://api.bamboohr.com/api/gateway.php"
gcal: gcal:
currentIcon: "💥" currentIcon: "💥"
enabled: true enabled: false
eventCount: 10 eventCount: 10
position: position:
top: 2 top: 2
@ -31,7 +31,7 @@ wtf:
refreshInterval: 8 refreshInterval: 8
repository: "/Users/chris/go/src/github.com/senorprogrammer/wtf" repository: "/Users/chris/go/src/github.com/senorprogrammer/wtf"
github: github:
enabled: true enabled: false
organization: "BetterOfficeApps" organization: "BetterOfficeApps"
position: position:
top: 2 top: 2
@ -42,7 +42,7 @@ wtf:
repo: "core-api" repo: "core-api"
username: "senorprogrammer" username: "senorprogrammer"
jira: jira:
enabled: true enabled: false
position: position:
top: 1 top: 1
left: 1 left: 1
@ -60,7 +60,7 @@ wtf:
width: 3 width: 3
refreshInterval: 900 refreshInterval: 900
opsgenie: opsgenie:
enabled: true enabled: false
position: position:
top: 2 top: 2
left: 0 left: 0
@ -85,7 +85,7 @@ wtf:
refreshInterval: 1 refreshInterval: 1
weather: weather:
cityId: 6173331 cityId: 6173331
enabled: true enabled: false
language: "EN" language: "EN"
position: position:
top: 0 top: 0

View File

@ -2,7 +2,6 @@ package github
import ( import (
"context" "context"
//"fmt"
"net/http" "net/http"
"os" "os"
@ -32,8 +31,6 @@ func (client *Client) PullRequests(orgName string, repoName string) ([]*ghb.Pull
if err != nil { if err != nil {
return nil, err return nil, err
//fmt.Printf("Problem in getting pull request information %v\n", err)
//os.Exit(1)
} }
return prs, nil return prs, nil
@ -47,8 +44,6 @@ func (client *Client) Repository(orgName string, repoName string) (*ghb.Reposito
if err != nil { if err != nil {
return nil, err return nil, err
//fmt.Printf("Problem in getting repository information %v\n", err)
//os.Exit(1)
} }
return repo, nil return repo, nil

View File

@ -59,7 +59,10 @@ func (widget *Widget) addView() {
} }
func (widget *Widget) contentFrom(deploys []nr.ApplicationDeployment) string { func (widget *Widget) contentFrom(deploys []nr.ApplicationDeployment) string {
str := " [red]Latest Deploys[white]\n" str := fmt.Sprintf(
" %s\n",
"[red]Latest Deploys[white]",
)
revisions := []string{} revisions := []string{}

26
wtf/position.go Normal file
View File

@ -0,0 +1,26 @@
package wtf
import ()
type Position struct {
top int
left int
width int
height int
}
func (pos *Position) Top() int {
return pos.top
}
func (pos *Position) Left() int {
return pos.left
}
func (pos *Position) Width() int {
return pos.width
}
func (pos *Position) Height() int {
return pos.height
}

View File

@ -10,31 +10,6 @@ import (
var Config *config.Config var Config *config.Config
type Position struct {
top int
left int
width int
height int
}
func (pos *Position) Top() int {
return pos.top
}
func (pos *Position) Left() int {
return pos.left
}
func (pos *Position) Width() int {
return pos.width
}
func (pos *Position) Height() int {
return pos.height
}
/* -------------------- TextWidget -------------------- */
type TextWidget struct { type TextWidget struct {
enabled bool enabled bool