2024-01-09 01:16:00 -06:00
|
|
|
// This is a simple example
|
|
|
|
package main
|
|
|
|
|
2024-01-18 00:58:14 -06:00
|
|
|
import (
|
2024-01-15 08:11:08 -06:00
|
|
|
"embed"
|
2024-01-26 02:04:19 -06:00
|
|
|
"fmt"
|
|
|
|
"time"
|
2024-01-09 10:21:58 -06:00
|
|
|
|
2024-01-09 02:00:51 -06:00
|
|
|
"go.wit.com/log"
|
|
|
|
|
2024-01-18 05:03:04 -06:00
|
|
|
"go.wit.com/gui"
|
2024-01-09 01:16:00 -06:00
|
|
|
)
|
|
|
|
|
2024-01-15 21:11:28 -06:00
|
|
|
//go:embed resources/*
|
2024-01-15 08:11:08 -06:00
|
|
|
var resToolkit embed.FS
|
|
|
|
|
2024-01-09 01:16:00 -06:00
|
|
|
func main() {
|
2024-01-23 11:22:33 -06:00
|
|
|
me = new(autoType)
|
2024-01-24 22:22:34 -06:00
|
|
|
me.allrepos = make(map[string]*repo)
|
2024-01-18 05:03:04 -06:00
|
|
|
|
|
|
|
me.myGui = gui.New()
|
|
|
|
me.myGui.InitEmbed(resToolkit)
|
2024-01-18 14:46:20 -06:00
|
|
|
// me.myGui.LoadToolkit("nocui")
|
2024-01-18 05:03:04 -06:00
|
|
|
me.myGui.Default()
|
2024-01-09 01:16:00 -06:00
|
|
|
|
2024-01-16 11:56:55 -06:00
|
|
|
autotypistWindow()
|
2024-01-30 13:09:24 -06:00
|
|
|
repolistWindow()
|
|
|
|
|
|
|
|
for _, repo := range me.allrepos {
|
|
|
|
repo.status.Update()
|
|
|
|
repo.newScan()
|
|
|
|
}
|
2024-01-20 17:17:48 -06:00
|
|
|
|
2024-01-26 02:04:19 -06:00
|
|
|
// scan repos every 30 seconds
|
|
|
|
// check every second for the checkbox changing
|
|
|
|
var i int = 60
|
2024-01-26 11:59:59 -06:00
|
|
|
myTicker(1*time.Second, "newScan()", func() {
|
2024-01-26 02:04:19 -06:00
|
|
|
i += 1
|
2024-01-26 11:59:59 -06:00
|
|
|
if !me.scanEveryMinute.Checked() {
|
2024-01-26 02:04:19 -06:00
|
|
|
if i < 60 {
|
|
|
|
i = 60
|
|
|
|
}
|
|
|
|
// print every 13 seconds
|
|
|
|
if i%13 == 0 {
|
|
|
|
log.Info("Not auto scanning", i)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if i < 60 {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
i = 0
|
|
|
|
duration := timeFunction(func() {
|
|
|
|
scanGoSum()
|
|
|
|
for _, repo := range me.allrepos {
|
|
|
|
repo.newScan()
|
|
|
|
}
|
|
|
|
})
|
2024-01-30 23:38:46 -06:00
|
|
|
/*
|
2024-01-26 02:04:19 -06:00
|
|
|
s := fmt.Sprint(duration)
|
|
|
|
me.autoWorkingPwd.SetText(s)
|
2024-01-30 23:38:46 -06:00
|
|
|
*/
|
2024-01-26 02:04:19 -06:00
|
|
|
})
|
2024-01-09 01:16:00 -06:00
|
|
|
}
|
|
|
|
|
2024-01-16 11:56:55 -06:00
|
|
|
func autotypistWindow() {
|
2024-01-18 05:03:04 -06:00
|
|
|
win := me.myGui.NewWindow("autotypist for GO & git. it types faster than you can.")
|
2024-01-17 20:52:07 -06:00
|
|
|
box := win.NewBox("bw hbox", true)
|
2024-01-20 17:17:48 -06:00
|
|
|
|
2024-01-16 11:56:55 -06:00
|
|
|
globalDisplayOptions(box)
|
|
|
|
globalBuildOptions(box)
|
|
|
|
globalResetOptions(box)
|
|
|
|
|
|
|
|
}
|