Silan error: list index out of range

cosmetic bug fix to prevent so much logging
This commit is contained in:
Martin Konecny 2013-04-05 14:20:34 -04:00
parent cdb53048c7
commit afb55c7b51
1 changed files with 3 additions and 2 deletions

View File

@ -47,8 +47,9 @@ class SilanAnalyzer(Thread):
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
out = proc.communicate()[0].strip('\r\n')
info = json.loads(out)
data['cuein'] = str('{0:f}'.format(info['sound'][0][0]))
data['cueout'] = str('{0:f}'.format(info['sound'][-1][1]))
if len(info['sound']) >= 2:
data['cuein'] = str('{0:f}'.format(info['sound'][0][0]))
data['cueout'] = str('{0:f}'.format(info['sound'][-1][1]))
except Exception, e:
self.logger.error(str(command))
self.logger.error(e)