From: W. Trevor King Date: Sun, 13 Jan 2013 13:49:46 +0000 (-0500) Subject: script-publish.py: Add debugging output for the chunk stream X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c80855be158800ae66841b267c991483dc160e45;p=mw2txt.git script-publish.py: Add debugging output for the chunk stream So you can take a look at the raw stream before we start dumping stuff. I also made the SGR skipping message more explicit. --- diff --git a/posts/script/script-publish.py b/posts/script/script-publish.py index 7423395..c156fde 100755 --- a/posts/script/script-publish.py +++ b/posts/script/script-publish.py @@ -256,7 +256,7 @@ class SelectGraphicRendition (ControlCode): 'foreground', DEFAULT_STYLE['foreground']) style['foreground'] = f elif code == 27: - _LOG.debug('skipping {}'.format(self)) + _LOG.debug('skipping {} code {}'.format(self.name, code)) elif code >= 30 and code <= 37: style['foreground'] = self.colors[code - 30] elif code == 39: # default text color @@ -581,6 +581,8 @@ class ControlParser (object): def parse(self, element, text): chunks = self._replace_control_codes(text) chunks = self._decode_text(chunks) + for chunk in chunks: + _LOG.debug(chunk) chunks = self._replace_tabs(chunks) chunks = self._merge_adjacent_text(chunks) chunks = self._remove_operating_system_commands(chunks)