Exemplo n.º 1
0
func execAsync(command string, args ...string) error {
	e := exec.Command(command, args...).Start()
	if e != nil {
		log.Println(term.Red("Launch failed error"), e, args)
	}
	return e
}
Exemplo n.º 2
0
func logE(action string, e error) (wasErr bool) {
	if e != nil {
		wasErr = true
		log.Println(term.Red("Error"), e)
	}
	return wasErr
}
Exemplo n.º 3
0
func printSubByRef(title string, byref subByRef) {
	if len(byref) == 0 {
		return
	}
	fmt.Println(term.Underscore + title + term.Reset)
	for imdb, bylang := range byref {
		fmt.Println(term.Red("Movie ref :"), imdb)
		for lang, list := range bylang {
			fmt.Println(" ", term.Yellow(lang))
			for index, sub := range list {
				fmt.Println(" ", term.FgGreen, index, term.Reset, sub.SubAddDate[:10], term.Yellow(sub.SubDownloadsCnt), sub.UserNickName, term.Bracket(sub.UserRank))
				//~ fmt.Printf(" ", " ", "#%d : %# v\n", index,sub)
			}
		}
	}
	fmt.Println()
}
Exemplo n.º 4
0
func testFatal(e error) {
	if e != nil {
		log.Println(term.Red("Applet load error"), e)
		os.Exit(2)
	}
}