more code reorg

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-13 23:42:06 -06:00
parent 15bcdb006e
commit 595f4c6eb3
2 changed files with 58 additions and 51 deletions

View File

@ -7,7 +7,6 @@ import (
"go.wit.com/log"
"go.wit.com/gui/gadgets/repostatus"
"go.wit.com/apps/control-panel-dns/smartwindow"
)
@ -62,53 +61,3 @@ func myrepolist() []string {
lines := strings.Split(out, "\n")
return lines
}
func (r *repo) newScan() bool {
if r.status == nil {
log.Warn("repo.status = nil. not initialized for some reason")
return false
}
// r.scan()
if repostatus.VerifyLocalGoRepo(r.getPath()) {
log.Warn("repo actually exists", r.getPath())
} else {
log.Warn("repo does not exist", r.getPath())
return false
}
mn := r.status.GetMasterName()
mv := r.status.GetMasterVersion()
r.masterVersion.Set(mn + " " + mv)
dn := r.status.GetDevelName()
dv := r.status.GetDevelVersion()
r.develVersion.Set(dn + " " + dv)
un := r.status.GetUserName()
uv := r.status.GetUserVersion()
r.jcarrVersion.Set(un + " " + uv)
cbname := r.status.GetCurrentBranchName()
cbversion := r.status.GetCurrentBranchVersion()
ltversion := r.status.GetLastTagVersion()
r.lastLabel.Set(cbname + " " + cbversion)
r.vLabel.Set(cbname + " " + ltversion)
if r.status.CheckDirty() {
log.Warn("CheckDirty() true")
r.dirtyLabel.Set("dirty")
return false
}
log.Warn("CheckDirty() no")
r.dirtyLabel.Set("not dirty")
if r.status.CheckBranches() {
log.Warn("Branches are Perfect")
r.dirtyLabel.SetText("PEFECT")
return true
} else {
log.Warn("Branches are not Perfect")
r.dirtyLabel.SetText("merge")
}
return false
}

58
scan.go Normal file
View File

@ -0,0 +1,58 @@
// This is a simple example
package main
import (
"go.wit.com/log"
"go.wit.com/gui/gadgets/repostatus"
)
func (r *repo) newScan() bool {
if r.status == nil {
log.Warn("repo.status = nil. not initialized for some reason")
return false
}
// r.scan()
if repostatus.VerifyLocalGoRepo(r.getPath()) {
log.Warn("repo actually exists", r.getPath())
} else {
log.Warn("repo does not exist", r.getPath())
return false
}
mn := r.status.GetMasterName()
mv := r.status.GetMasterVersion()
r.masterVersion.Set(mn + "\n" + mv)
dn := r.status.GetDevelName()
dv := r.status.GetDevelVersion()
r.develVersion.Set(dn + "\n" + dv)
un := r.status.GetUserName()
uv := r.status.GetUserVersion()
r.jcarrVersion.Set(un + "\n" + uv)
cbname := r.status.GetCurrentBranchName()
cbversion := r.status.GetCurrentBranchVersion()
ltversion := r.status.GetLastTagVersion()
r.lastLabel.Set(cbname + "\n" + cbversion)
r.vLabel.Set(cbname + "\n" + ltversion)
if r.status.CheckDirty() {
log.Warn("CheckDirty() true")
r.dirtyLabel.Set("dirty")
return false
}
log.Warn("CheckDirty() no")
r.dirtyLabel.Set("not dirty")
if r.status.CheckBranches() {
log.Warn("Branches are Perfect")
r.dirtyLabel.SetText("PEFECT")
return true
} else {
log.Warn("Branches are not Perfect")
r.dirtyLabel.SetText("merge")
}
return false
}