pull/180/head
liuzheng712 2016-03-29 21:05:29 +08:00
parent cf1da2a420
commit 1c61ed6a8b
1 changed files with 10 additions and 1 deletions

View File

@ -84,7 +84,16 @@ def renderJSON(script_path, time_file_path):
# with open(script_path) as scriptf:
with open(time_file_path) as timef:
timing = getTiming(timef)
json = scriptToJSON(scriptf, timing)
ret = {}
with closing(scriptf):
scriptf.readline() # ignore first header line from script file
offset = 0
for t in timing:
dt = scriptf.read(t[1])
data = escapeString(dt)
# print ('###### (%s, %s)' % (t[1], repr(data)))
offset += t[0]
ret[str(offset/float(1000))] = data
return json
def kill_invalid_connection():