From c80855be158800ae66841b267c991483dc160e45 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 13 Jan 2013 08:49:46 -0500 Subject: [PATCH] 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. --- posts/script/script-publish.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.26.2