MiRCARTCanonicalise.py: correctly reset last{Attribs,Colours} on each new row (fixes issue #1.)

This commit is contained in:
Lucio Andrés Illanes Albornoz 2018-06-17 09:45:00 +02:00
parent 9a9d5d858d
commit 8d6f6ef56e

View File

@ -29,9 +29,9 @@ def canonicalise(inPathName):
canvasStore = MiRCARTCanvasImportStore(inPathName) canvasStore = MiRCARTCanvasImportStore(inPathName)
inMap = canvasStore.outMap.copy(); del canvasStore; inMap = canvasStore.outMap.copy(); del canvasStore;
with open(inPathName, "w+") as outFile: with open(inPathName, "w+") as outFile:
for inCurRow in range(len(inMap)):
lastAttribs = MiRCARTCanvasImportStore._CellState.CS_NONE lastAttribs = MiRCARTCanvasImportStore._CellState.CS_NONE
lastColours = None lastColours = None
for inCurRow in range(len(inMap)):
for inCurCol in range(len(inMap[inCurRow])): for inCurCol in range(len(inMap[inCurRow])):
inCurCell = inMap[inCurRow][inCurCol] inCurCell = inMap[inCurRow][inCurCol]
if lastAttribs != inCurCell[2]: if lastAttribs != inCurCell[2]: