fix dumpLog.py

This commit is contained in:
Erwin Coumans 2017-09-06 14:34:10 -07:00
parent c82131d16e
commit cfc07565ac

View File

@ -31,15 +31,20 @@ def readLogFile(filename, verbose = True):
print('Columns:'),
print(ncols)
# Read data
wholeFile = f.read()
# split by alignment word
chunks = wholeFile.split(b'\xaa\xbb')
lenChunk = sz
log = list()
chunkIndex = 0
while (lenChunk):
check = f.read(2)
lenChunk = 0
if (check == b'\xaa\xbb'):
mychunk = f.read(sz)
lenChunk = len(mychunk)
chunks = [mychunk]
if verbose:
print("num chunks:")
print(len(chunks))
chunkIndex = 0
for chunk in chunks:
print("len(chunk)=",len(chunk)," sz = ", sz)
if len(chunk) == sz:
@ -53,7 +58,8 @@ def readLogFile(filename, verbose = True):
print(" ",keys[i],"=",values[i])
log.append(record)
else:
print("Error, expected aabb terminal")
return log