CC-5309:Calendar-> Recording Show: Fail to open context menu

Better error msg, also add more information in show-record.log
This commit is contained in:
cliff.wang 2013-08-23 14:23:47 -04:00
parent ceba84d1f7
commit 12a62a3827
3 changed files with 19 additions and 7 deletions

View file

@ -10,6 +10,7 @@ import pytz
import signal
import math
import traceback
import re
from configobj import ConfigObj
@ -17,6 +18,7 @@ from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
from subprocess import Popen
from subprocess import PIPE
from threading import Thread
import mutagen
@ -93,12 +95,16 @@ class ShowRecorder(Thread):
self.logger.info("starting record")
self.logger.info("command " + command)
self.p = Popen(args)
self.p = Popen(args,stdout=PIPE)
#blocks at the following line until the child process
#quits
self.p.wait()
outmsgs = self.p.stdout.readlines()
for msg in outmsgs:
m = re.search('^ERROR',msg)
if not m == None:
self.logger.info('Recording error is found: %s', msg)
self.logger.info("finishing record, return code %s", self.p.returncode)
code = self.p.returncode