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