# HG changeset patch # User morphbr # Date 1179267917 -3600 # Node ID ba4a948c4a5543649b92a37fd901aec853f9e049 # Parent 3816ffef9ff1eb7b7e1a907c223b5592d4451126 [svn r666] * GMyth-Streamer - Updated report status on mencoder.py diff -r 3816ffef9ff1 -r ba4a948c4a55 gmyth-stream/server/0.2/plugins/transcoders/mencoder.py --- a/gmyth-stream/server/0.2/plugins/transcoders/mencoder.py Tue May 15 22:35:57 2007 +0100 +++ b/gmyth-stream/server/0.2/plugins/transcoders/mencoder.py Tue May 15 23:25:17 2007 +0100 @@ -196,7 +196,9 @@ os.write(stdw, data_in) total_read += 4096 d = stdout.read(4096) - self.status = total_read * 100 / size + self.status = utils.progress_bar(self.log, + int(total_read), + int(size), 50) else: finished = True os.close(stdw) @@ -260,34 +262,24 @@ return ret # start() - - def stop(self): - if self.proc: + def _aux_stop(self, obj): + if obj: try: - os.kill(self.proc.pid, signal.SIGKILL) + os.kill(obj.pid, signal.SIGKILL) except OSError, e: pass try: - self.proc.wait() + obj.wait() except Exception, e: pass - self.proc = None + obj = None + # _aux_stop - if self.gmyth: - try: - os.kill(self.gmyth.pid, signal.SIGKILL) - except OSError, e: - pass - - try: - self.gmyth.wait() - except Exception, e: - pass - - self.gmyth = None - + def stop(self): + self._aux_stop(self.proc) + self._aux_stop(self.gmyth) # stop() # TranscoderMencoder