2024-01-13 23:27:46 -06:00
|
|
|
// This is a simple example
|
|
|
|
package main
|
|
|
|
|
2024-01-18 00:58:14 -06:00
|
|
|
import (
|
2024-01-13 23:27:46 -06:00
|
|
|
"io/ioutil"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2024-01-18 05:03:04 -06:00
|
|
|
func (r *repo) String() string {
|
|
|
|
return r.status.String()
|
|
|
|
}
|
|
|
|
|
2024-01-13 23:27:46 -06:00
|
|
|
func (r *repo) getPath() string {
|
|
|
|
return r.path
|
|
|
|
}
|
|
|
|
|
|
|
|
func RemoveFirstElement(slice []string) (string, []string) {
|
|
|
|
if len(slice) == 0 {
|
|
|
|
return "", slice // Return the original slice if it's empty
|
|
|
|
}
|
|
|
|
return slice[0], slice[1:] // Return the slice without the first element
|
|
|
|
}
|
|
|
|
|
|
|
|
// returns path, master branch name, devel branch name, user branch name
|
|
|
|
func splitLine(line string) (string, string, string, string) {
|
|
|
|
var path, master, devel, user string
|
|
|
|
parts := strings.Split(line, " ")
|
|
|
|
path, parts = RemoveFirstElement(parts)
|
|
|
|
master, parts = RemoveFirstElement(parts)
|
|
|
|
devel, parts = RemoveFirstElement(parts)
|
|
|
|
user, parts = RemoveFirstElement(parts)
|
|
|
|
// path, master, devel, user := strings.Split(line, " ")
|
|
|
|
return path, master, devel, user
|
|
|
|
}
|
|
|
|
|
|
|
|
func myrepolist() []string {
|
|
|
|
content, _ := ioutil.ReadFile("/home/jcarr/.config/myrepolist")
|
|
|
|
out := string(content)
|
|
|
|
out = strings.TrimSpace(out)
|
|
|
|
lines := strings.Split(out, "\n")
|
|
|
|
return lines
|
|
|
|
}
|
2024-01-19 18:37:27 -06:00
|
|
|
|
|
|
|
func (r *repo) Hide() {
|
|
|
|
r.pLabel.Hide()
|
|
|
|
r.lastTag.Hide()
|
|
|
|
r.vLabel.Hide()
|
|
|
|
|
|
|
|
r.masterVersion.Hide()
|
|
|
|
r.develVersion.Hide()
|
|
|
|
r.userVersion.Hide()
|
2024-01-20 18:45:55 -06:00
|
|
|
|
2024-01-19 18:37:27 -06:00
|
|
|
r.dirtyLabel.Hide()
|
2024-01-25 02:37:04 -06:00
|
|
|
r.goSumStatus.Hide()
|
2024-01-23 11:22:33 -06:00
|
|
|
r.statusButton.Hide()
|
2024-01-19 18:37:27 -06:00
|
|
|
r.hidden = true
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *repo) Show() {
|
|
|
|
r.pLabel.Show()
|
|
|
|
r.lastTag.Show()
|
|
|
|
r.vLabel.Show()
|
|
|
|
|
|
|
|
r.masterVersion.Show()
|
|
|
|
r.develVersion.Show()
|
|
|
|
r.userVersion.Show()
|
2024-01-20 18:45:55 -06:00
|
|
|
|
2024-01-19 18:37:27 -06:00
|
|
|
r.dirtyLabel.Show()
|
2024-01-25 02:37:04 -06:00
|
|
|
r.goSumStatus.Show()
|
2024-01-23 11:22:33 -06:00
|
|
|
r.statusButton.Show()
|
2024-01-19 18:37:27 -06:00
|
|
|
r.hidden = false
|
|
|
|
}
|