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

RefreshedAt moved to the end of the refresh (because that makes more sense, doesn't it?)

This commit is contained in:
Chris Cummer 2018-04-13 16:14:57 -07:00 committed by Chris Cummer
parent d44933aba4
commit 84ecf296a5
12 changed files with 34 additions and 16 deletions

View File

@ -43,10 +43,11 @@ func (widget *Widget) Refresh() {
)
widget.View.SetTitle(fmt.Sprintf(" 👽 Away (%d) ", len(todayItems)))
widget.RefreshedAt = time.Now()
widget.View.Clear()
fmt.Fprintf(widget.View, "%s", widget.contentFrom(todayItems))
widget.RefreshedAt = time.Now()
}
/* -------------------- Unexported Functions -------------------- */

View File

@ -1 +0,0 @@
theme: jekyll-theme-tactile

View File

@ -37,10 +37,10 @@ func (widget *Widget) Refresh() {
events, _ := Fetch()
widget.RefreshedAt = time.Now()
widget.View.Clear()
fmt.Fprintf(widget.View, "%s", widget.contentFrom(events))
widget.RefreshedAt = time.Now()
}
/* -------------------- Unexported Functions -------------------- */
@ -207,5 +207,5 @@ func (widget *Widget) until(event *calendar.Event) string {
untilStr = fmt.Sprintf("%dm", mins)
}
return "[grey]" + untilStr + "[white]"
return "[lightblue]" + untilStr + "[white]"
}

View File

@ -40,10 +40,11 @@ func (widget *Widget) Refresh() {
title := fmt.Sprintf("[green]%s[white]\n", data["repo"][0])
widget.View.SetTitle(fmt.Sprintf(" Git: %s ", title))
widget.RefreshedAt = time.Now()
widget.View.Clear()
fmt.Fprintf(widget.View, "%s", widget.contentFrom(data))
widget.RefreshedAt = time.Now()
}
/* -------------------- Unexported Functions -------------------- */

View File

@ -38,7 +38,6 @@ func (widget *Widget) Refresh() {
prs, _ := client.PullRequests(Config.UString("wtf.mods.github.owner"), Config.UString("wtf.mods.github.repo"))
widget.View.SetTitle(fmt.Sprintf(" Github: %s ", widget.title()))
widget.RefreshedAt = time.Now()
str := " [red]Open Review Requests[white]\n"
str = str + widget.prsForReview(prs, Config.UString("wtf.mods.github.username"))
@ -48,6 +47,8 @@ func (widget *Widget) Refresh() {
widget.View.Clear()
fmt.Fprintf(widget.View, str)
widget.RefreshedAt = time.Now()
}
/* -------------------- Unexported Functions -------------------- */

View File

@ -35,8 +35,6 @@ func (widget *Widget) Refresh() {
searchResult, err := IssuesFor(Config.UString("wtf.mods.jira.username"))
widget.RefreshedAt = time.Now()
widget.View.Clear()
if err != nil {
@ -54,6 +52,8 @@ func (widget *Widget) Refresh() {
)
fmt.Fprintf(widget.View, "%s", widget.contentFrom(searchResult))
}
widget.RefreshedAt = time.Now()
}
/* -------------------- Unexported Functions -------------------- */

View File

@ -43,7 +43,6 @@ func (widget *Widget) Refresh() {
}
widget.View.SetTitle(fmt.Sprintf(" New Relic: [green]%s[white] ", appName))
widget.RefreshedAt = time.Now()
widget.View.Clear()
@ -54,6 +53,8 @@ func (widget *Widget) Refresh() {
widget.View.SetWrap(false)
fmt.Fprintf(widget.View, "%s", widget.contentFrom(deploys))
}
widget.RefreshedAt = time.Now()
}
/* -------------------- Unexported Functions -------------------- */

View File

@ -37,7 +37,6 @@ func (widget *Widget) Refresh() {
data, err := Fetch()
widget.View.SetTitle(" ⏰ On Call ")
widget.RefreshedAt = time.Now()
widget.View.Clear()
@ -48,6 +47,8 @@ func (widget *Widget) Refresh() {
widget.View.SetWrap(false)
fmt.Fprintf(widget.View, "%s", widget.contentFrom(data))
}
widget.RefreshedAt = time.Now()
}
/* -------------------- Unexported Functions -------------------- */

View File

@ -36,10 +36,10 @@ func (widget *Widget) Refresh() {
data := NewSecurityData()
data.Fetch()
widget.RefreshedAt = time.Now()
widget.View.Clear()
fmt.Fprintf(widget.View, "%s", widget.contentFrom(data))
widget.RefreshedAt = time.Now()
}
/* -------------------- Unexported Functions -------------------- */

View File

@ -37,8 +37,6 @@ func (widget *Widget) Refresh() {
return
}
widget.RefreshedAt = time.Now()
_, _, w, _ := widget.View.GetInnerRect()
widget.View.Clear()
@ -48,6 +46,8 @@ func (widget *Widget) Refresh() {
widget.animation(),
widget.timezones(),
)
widget.RefreshedAt = time.Now()
}
/* -------------------- Unexported Functions -------------------- */

View File

@ -38,10 +38,11 @@ func (widget *Widget) Refresh() {
data := Fetch(Config.UInt("wtf.mods.weather.cityId", 6176823))
widget.View.SetTitle(fmt.Sprintf(" %s %s ", icon(data), data.Name))
widget.RefreshedAt = time.Now()
widget.View.Clear()
fmt.Fprintf(widget.View, "%s", widget.contentFrom(data))
widget.RefreshedAt = time.Now()
}
/* -------------------- Unexported Functions -------------------- */

13
wtf/config_watcher.rb Normal file
View File

@ -0,0 +1,13 @@
package wtf
import(
"time"
)
type ConfigWatcher struct {
UpdatedAt *time.Time
}
func (watcher *ConfigWatcher) Watch() {
}