MiRC2png.py:MiRC2png._syncColourSpecState(): handle empty mIRC colour control code sequences.

This commit is contained in:
Lucio Andrés Illanes Albornoz 2018-01-05 16:48:50 +01:00
parent 496e4c7a4b
commit ba99dc1280

View File

@ -209,14 +209,15 @@ class MiRC2png:
# }}} # }}}
# {{{ _syncColourSpecState(): XXX # {{{ _syncColourSpecState(): XXX
def _syncColourSpecState(self, colourSpec): def _syncColourSpecState(self, colourSpec):
colourSpec = colourSpec.split(",") if len(colourSpec) > 0:
if len(colourSpec) == 2: colourSpec = colourSpec.split(",")
self.outCurColourFg = int(colourSpec[0]) if len(colourSpec) == 2:
self.outCurColourBg = int(colourSpec[1] or self.outCurColourBg) self.outCurColourFg = int(colourSpec[0])
elif len(colourSpec) == 1: self.outCurColourBg = int(colourSpec[1] or self.outCurColourBg)
self.outCurColourFg = int(colourSpec[0]) elif len(colourSpec) == 1:
else: self.outCurColourFg = int(colourSpec[0])
self.outCurColourBg = 1; self.outCurColourFg = 15; else:
self.outCurColourBg = 1; self.outCurColourFg = 15;
return True return True
# }}} # }}}