def _handle_pyout(self, msg):
self.log.debug("<STR_LIT>", msg.get('<STR_LIT:content>', '<STR_LIT>'))<EOL>if not self._hidden and self._is_from_this_session(msg):<EOL><INDENT>content = msg['<STR_LIT:content>']<EOL>prompt_number = content.get('<STR_LIT>', <NUM_LIT:0>)<EOL>data = content['<STR_LIT:data>']<EOL>if data.has_key('<STR_LIT>'):<EOL><INDENT>self._append_plain_text(self.output_sep, True)<EOL>self._append_html(self._make_out_prompt(prompt_number), True)<EOL>html = data['<STR_LIT>']<EOL>self._append_plain_text('<STR_LIT:\n>', True)<EOL>self._append_html(html + self.output_sep2, True)<EOL><DEDENT>elif data.has_key('<STR_LIT>'):<EOL><INDENT>self._append_plain_text(self.output_sep, True)<EOL>self._append_html(self._make_out_prompt(prompt_number), True)<EOL>text = data['<STR_LIT>']<EOL>if "<STR_LIT:\n>" in text and not self.output_sep.endswith("<STR_LIT:\n>"):<EOL><INDENT>self._append_plain_text('<STR_LIT:\n>', True)<EOL><DEDENT>self._append_plain_text(text + self.output_sep2, True)<EOL><DEDENT><DEDENT>
Reimplemented for IPython-style "display hook".