blob: 9a22624328b5f9477cfe04585ae273c7410f0d68 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
package repolist
import (
"go.wit.com/gui"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/log"
)
func Init(f *forgepb.Forge, g *gui.Node) *RepoList {
me = new(RepoList)
// todo: this code sucks. fix it soon
me.mainWindow = g.NewWindow("builds and uploads all the packages")
me.mainbox = me.mainWindow.NewBox("bw hbox", true)
// make a window with a table of all the repos
me.AutotypistView(me.mainbox)
me.Enable()
me.forge = f
me.viewName = "autotypist"
repos := me.forge.Repos.SortByGoPath()
for repos.Scan() {
repo := repos.Next()
if me.forge.IsReadOnly(repo.GoPath) {
log.Info("repo scan readonly directory:", repo.FullPath)
} else {
log.Info("repo scan writable directory:", repo.FullPath)
me.AddRepo(repo)
}
}
me.Enable()
return me
}
func InitBox(f *forgepb.Forge, newbox *gui.Node) *RepoList {
me = new(RepoList)
// make a window with a table of all the repos
me.AutotypistView(newbox)
me.Enable()
me.forge = f
me.viewName = "autotypist"
repos := me.forge.Repos.SortByGoPath()
for repos.Scan() {
repo := repos.Next()
if me.forge.IsReadOnly(repo.GoPath) {
log.Info("repo scan readonly directory:", repo.FullPath)
} else {
log.Info("repo scan writable directory:", repo.FullPath)
me.AddRepo(repo)
}
}
me.Enable()
return me
}
|