Commit 1c61ed6a authored by liuzheng712's avatar liuzheng712

bugfix

parent cf1da2a4
...@@ -84,7 +84,16 @@ def renderJSON(script_path, time_file_path): ...@@ -84,7 +84,16 @@ def renderJSON(script_path, time_file_path):
# with open(script_path) as scriptf: # with open(script_path) as scriptf:
with open(time_file_path) as timef: with open(time_file_path) as timef:
timing = getTiming(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 return json
def kill_invalid_connection(): def kill_invalid_connection():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment