|
|
|
@ -5,6 +5,7 @@ package mop |
|
|
|
|
import ( |
|
|
|
|
"github.com/michaeldv/just" |
|
|
|
|
"github.com/nsf/termbox-go" |
|
|
|
|
"time" |
|
|
|
|
"regexp" |
|
|
|
|
"strings" |
|
|
|
|
) |
|
|
|
@ -39,6 +40,12 @@ func Draw(stocks string) { |
|
|
|
|
drawScreen(Format(quotes)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
func DrawTime() { |
|
|
|
|
now := time.Now().Format("3:04:05pm PST") |
|
|
|
|
drawLine(0, 0, "<right>" + now + "</right>") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Return regular expression that matches all possible tags, i.e.
|
|
|
|
|
// </?black>|</?red>| ... |</?white>
|
|
|
|
@ -108,6 +115,7 @@ func drawLine(x int, y int, str string) { |
|
|
|
|
column += 1 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
termbox.Flush() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
@ -116,5 +124,4 @@ func drawScreen(str string) { |
|
|
|
|
for row, line := range strings.Split(str, "\n") { |
|
|
|
|
drawLine(0, row, line) |
|
|
|
|
} |
|
|
|
|
termbox.Flush() |
|
|
|
|
} |
|
|
|
|