7 now=time.strftime("%H:%M:%S", time.localtime())
8 print "*",now,'--',message
11 def popen(command, fatal=True):
12 (stdin, stdout, stderr) = os.popen3(command)
13 output = stdout.readlines()
15 # filter output generated by set x
16 remove_set_x = lambda line: not line.startswith("+")
17 errors = filter(remove_set_x, stderr.readlines())
20 raise Exception, "".join(errors)
21 return (output, errors)
23 def commands(command, fatal = True):
24 (status, output) = commands.getstatusoutput(command)
25 if fatal and not status == 0:
26 raise Exception, "%(command)s Failed:\n%(output)s" % locals()
27 return (status, output)