start using IterBy()

This commit is contained in:
Jeff Carr 2025-03-18 15:13:55 -05:00
parent 96aa1f09ea
commit 4b2ac683b7
3 changed files with 9 additions and 11 deletions

View File

@ -38,7 +38,7 @@ andlabs: clean install
forge --gui andlabs forge --gui andlabs
gocui: install gocui: install
forge --gui gocui --gui-verbose >/tmp/forge.log 2>&1 forge --gui gocui --gui-verbose --gui-file ../../toolkits/gocui/gocui.so >/tmp/forge.log 2>&1
# forge --gui gocui --gui-verbose --debugger # forge --gui gocui --gui-verbose --debugger
goimports: goimports:

View File

@ -160,7 +160,7 @@ func doRegister(newurl string) error {
} }
test := strings.TrimSpace(string(body)) test := strings.TrimSpace(string(body))
for _, line := range strings.Split(test, "\n") { for line := range strings.SplitSeq(test, "\n") {
line = strings.TrimSpace(line) line = strings.TrimSpace(line)
log.Info("server returned:", line) log.Info("server returned:", line)
} }

View File

@ -25,9 +25,7 @@ func makeReposWin() *gadgets.GenericWindow {
tb, box := makeStandardReposWindow("dirty repos", found) tb, box := makeStandardReposWindow("dirty repos", found)
hbox := box.Box().Horizontal() hbox := box.Box().Horizontal()
hbox.NewButton("commit all", func() { hbox.NewButton("commit all", func() {
all := found.SortByFullPath() for repo := range found.IterByFullPath() {
for all.Scan() {
repo := all.Next()
log.Info("do commit here on", repo.GetGoPath()) log.Info("do commit here on", repo.GetGoPath())
} }
log.Info("TODO: fix this") log.Info("TODO: fix this")
@ -55,9 +53,7 @@ func makeReposWin() *gadgets.GenericWindow {
// make the window for the first time // make the window for the first time
found := new(gitpb.Repos) found := new(gitpb.Repos)
all := me.forge.Repos.SortByFullPath() for repo := range me.forge.Repos.IterByFullPath() {
for all.Scan() {
repo := all.Next()
if me.forge.Config.IsReadOnly(repo.GetGoPath()) { if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
continue continue
} }
@ -367,9 +363,11 @@ func makeWritableWindow(pb *gitpb.Repos) (*gadgets.GenericWindow, *gitpb.ReposTa
log.Info("todo: run git pull on each repo") log.Info("todo: run git pull on each repo")
}) })
/*
grid.NewButton("do repos.ReScan()", func() { grid.NewButton("do repos.ReScan()", func() {
t.Update() t.Update()
}) })
*/
tbox := win.Bottom.Box() tbox := win.Bottom.Box()
t.SetParent(tbox) t.SetParent(tbox)