diff --git a/IPython/frontend/prefilterfrontend.py b/IPython/frontend/prefilterfrontend.py index 62a21f8..07ac19c 100644 --- a/IPython/frontend/prefilterfrontend.py +++ b/IPython/frontend/prefilterfrontend.py @@ -69,10 +69,6 @@ class PrefilterFrontEnd(LineFrontEndBase): setattr(_ip.IP, 'magic_%s' % alias_name, magic) # FIXME: I should create a real file-like object dedicated to this # terminal - Term.cout.flush = lambda : None - Term.cout.getvalue = lambda : '' - Term.cerr.flush = lambda : None - Term.cerr.getvalue = lambda : '' self.shell.output_trap = SyncOutputTrap(write_out=self.write, write_err=self.write) diff --git a/IPython/frontend/wx/console_widget.py b/IPython/frontend/wx/console_widget.py index 48900c2..c64a963 100644 --- a/IPython/frontend/wx/console_widget.py +++ b/IPython/frontend/wx/console_widget.py @@ -207,18 +207,16 @@ class ConsoleWidget(editwindow.EditWindow): self.AppendText(segment) if segments: - ansi_tags = self.color_pat.findall(text) - - for tag in ansi_tags: - i = segments.index(tag) + for ansi_tag, text in zip(segments[::2], segments[1::2]): self.StartStyling(self.GetLength(), 0xFF) - self.AppendText(segments[i+1]) + self.AppendText(text) - if tag != '0': - self.SetStyling(len(segments[i+1]), - self.ANSI_STYLES[tag][0]) + if ansi_tag == '0': + style = 0 + else: + style = self.ANSI_STYLES[ansi_tag][0] - segments.pop(i) + self.SetStyling(len(text), style) self.GotoPos(self.GetLength()) wx.Yield()