2024-01-09 01:16:00 -06:00
|
|
|
package main
|
|
|
|
|
2024-01-18 00:58:14 -06:00
|
|
|
import (
|
2024-01-15 08:11:08 -06:00
|
|
|
"embed"
|
2024-02-17 08:38:44 -06:00
|
|
|
"os/user"
|
|
|
|
"strings"
|
2024-01-09 10:21:58 -06:00
|
|
|
|
2024-02-13 09:18:04 -06:00
|
|
|
"go.wit.com/lib/debugger"
|
2024-02-17 08:38:44 -06:00
|
|
|
"go.wit.com/lib/gui/repostatus"
|
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-18 05:03:04 -06:00
|
|
|
|
|
|
|
me.myGui = gui.New()
|
|
|
|
me.myGui.InitEmbed(resToolkit)
|
|
|
|
me.myGui.Default()
|
2024-01-09 01:16:00 -06:00
|
|
|
|
2024-02-13 09:18:04 -06:00
|
|
|
me.autotypistWindow = me.myGui.NewWindow("autotypist: it types faster than you can.")
|
2024-02-13 16:18:37 -06:00
|
|
|
me.mainbox = me.autotypistWindow.NewBox("bw hbox", true)
|
2024-02-11 20:24:40 -06:00
|
|
|
|
2024-02-13 16:18:37 -06:00
|
|
|
vbox1 := me.mainbox.NewVerticalBox("BOX1")
|
2024-02-12 15:24:35 -06:00
|
|
|
globalDisplayOptions(vbox1)
|
2024-02-13 13:24:07 -06:00
|
|
|
docsBox(vbox1)
|
2024-02-13 09:18:04 -06:00
|
|
|
if debugger.ArgDebug() {
|
|
|
|
debuggerBox(vbox1)
|
|
|
|
}
|
2024-02-13 16:18:37 -06:00
|
|
|
// disable the interface while everything is scanned
|
|
|
|
me.Disable()
|
2024-02-12 15:24:35 -06:00
|
|
|
|
2024-02-13 16:18:37 -06:00
|
|
|
vbox2 := me.mainbox.NewVerticalBox("BOX2")
|
2024-02-12 15:24:35 -06:00
|
|
|
globalBuildOptions(vbox2)
|
2024-02-13 13:33:04 -06:00
|
|
|
me.summary = submitPatchesBox(vbox2)
|
2024-02-12 15:24:35 -06:00
|
|
|
|
2024-02-13 16:18:37 -06:00
|
|
|
globalResetOptions(me.mainbox)
|
2024-02-11 20:24:40 -06:00
|
|
|
|
2024-02-17 14:20:37 -06:00
|
|
|
me.repos = makeRepoView()
|
2024-02-17 08:38:44 -06:00
|
|
|
|
|
|
|
usr, _ := user.Current()
|
|
|
|
if args.OnlyMe {
|
|
|
|
log.Info("not scanning everything")
|
|
|
|
} else {
|
|
|
|
log.Info("scanning everything in ~/go/src")
|
|
|
|
for i, path := range repostatus.ListGitDirectories() {
|
|
|
|
// log.Info("addRepo()", i, path)
|
|
|
|
path = strings.TrimPrefix(path, me.goSrcPwd.String())
|
|
|
|
path = strings.Trim(path, "/")
|
|
|
|
log.Info("addRepo()", i, path)
|
2024-02-17 14:20:37 -06:00
|
|
|
me.repos.View.AddRepo(path, "master", "devel", usr.Username)
|
2024-02-17 08:38:44 -06:00
|
|
|
}
|
|
|
|
}
|
2024-01-30 13:09:24 -06:00
|
|
|
|
2024-02-10 16:35:58 -06:00
|
|
|
// process everything on the command line
|
|
|
|
handleCmdLine()
|
|
|
|
|
2024-02-17 14:20:37 -06:00
|
|
|
me.repos.View.ScanRepositories()
|
2024-02-13 16:18:37 -06:00
|
|
|
me.Enable()
|
2024-01-20 17:17:48 -06:00
|
|
|
|
2024-02-14 13:43:43 -06:00
|
|
|
// processing is done. update the repo summary box
|
|
|
|
me.summary.Update()
|
|
|
|
|
2024-02-17 08:38:44 -06:00
|
|
|
// intermittently scans the status indefinitly
|
2024-02-17 14:20:37 -06:00
|
|
|
me.repos.View.Watchdog()
|
2024-01-09 01:16:00 -06:00
|
|
|
}
|