New option to delist login from main list
This commit is contained in:
parent
45aef0b637
commit
303d748029
16
main.go
16
main.go
@ -16,6 +16,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var gdprExceptions arrayFlags
|
||||||
var students [][]string
|
var students [][]string
|
||||||
var rendusDir string
|
var rendusDir string
|
||||||
var title string
|
var title string
|
||||||
@ -140,6 +141,11 @@ func genStudents() map[string]map[string]*Submission {
|
|||||||
|
|
||||||
for _, student := range students {
|
for _, student := range students {
|
||||||
login := student[2]
|
login := student[2]
|
||||||
|
|
||||||
|
if gdprExceptions.Contains(login) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
ret[login] = genStudent(login)
|
ret[login] = genStudent(login)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,11 +252,21 @@ func (i *arrayFlags) Set(value string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (i *arrayFlags) Contains(value string) bool {
|
||||||
|
for _, v := range *i {
|
||||||
|
if v == value {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var studentsFiles arrayFlags
|
var studentsFiles arrayFlags
|
||||||
|
|
||||||
var bind = flag.String("bind", "0.0.0.0:8081", "Bind port/socket")
|
var bind = flag.String("bind", "0.0.0.0:8081", "Bind port/socket")
|
||||||
flag.Var(&studentsFiles, "students", "Path to a CSV file containing in the third column the name of the directory to look for (can be repeated multiple times)")
|
flag.Var(&studentsFiles, "students", "Path to a CSV file containing in the third column the name of the directory to look for (can be repeated multiple times)")
|
||||||
|
flag.Var(&gdprExceptions, "gdpr-exception", "Login that should not be listed in global rendus.json (can be repeated multiple times)")
|
||||||
flag.StringVar(&rendusDir, "path", "./rendu/", "Path to the submissions directory (each subdirectory is a project)")
|
flag.StringVar(&rendusDir, "path", "./rendu/", "Path to the submissions directory (each subdirectory is a project)")
|
||||||
flag.StringVar(&title, "title", "Rendus VIRLI", "Title of the page")
|
flag.StringVar(&title, "title", "Rendus VIRLI", "Title of the page")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
Reference in New Issue
Block a user