X-Git-Url: http://git.onelab.eu/?p=pcucontrol.git;a=blobdiff_plain;f=pcucontrol%2Futil%2Fcommand.py;fp=pcucontrol%2Futil%2Fcommand.py;h=173255baa9ea3fbbfd67568443dbba5a29100931;hp=74b5faeeb93fb23aca2e4ed8eddadb163216e9df;hb=dd516e0f7a0f19fbc20204be8acca09687919db9;hpb=51e66ab7b975799462e6b6c93494f4781fecacf7 diff --git a/pcucontrol/util/command.py b/pcucontrol/util/command.py index 74b5fae..173255b 100644 --- a/pcucontrol/util/command.py +++ b/pcucontrol/util/command.py @@ -36,8 +36,8 @@ def read_t(stream, count=1, timeout=COMMAND_TIMEOUT*2): while True: lin, lout, lerr = select([stream], [], [], timeout) if len(lin) == 0: - print "timeout!" - raise ExceptionReadTimeout("TIMEOUT reading from command") + #print "timeout!" + raise ExceptionReadTimeout("TIMEOUT while reading from command") try: outbytes = stream.read(count) @@ -55,7 +55,7 @@ def read_t(stream, count=1, timeout=COMMAND_TIMEOUT*2): else: lin, lout, lerr = select([stream], [], [], timeout) if len(lin) == 0: - raise ExceptionReadTimeout("TIMEOUT reading from command") + raise ExceptionReadTimeout("TIMEOUT while reading from command") return stream.read(count) @@ -68,10 +68,10 @@ class CMD: try: return CMD.run(self,cmd,timeout) except ExceptionTimeout: - print traceback.print_exc() + #print traceback.print_exc() return ("", "ScriptTimeout") except ExceptionReadTimeout: - print traceback.print_exc() + #print traceback.print_exc() return ("", "RunningScriptTimeout") except KeyboardInterrupt: print "Interrupted, exiting..." @@ -101,7 +101,7 @@ class CMD: lout, lin, lerr = select([f_out], [], [f_err], timeout) if len(lin) == 0 and len(lout) == 0 and len(lerr) == 0: # Reached a timeout! Nuke process so it does not hang. - print "TIMEOUT!!!!!!!!!!!!!!!!!!!" + #print "TIMEOUT!!!!!!!!!!!!!!!!!!!" s.kill(signal.SIGKILL) raise ExceptionTimeout("TIMEOUT Running: %s" % cmd) else: