From 6ce200439840422c2f462218634de0a0d5df400a 2010-08-23 15:14:38 From: epatters Date: 2010-08-23 15:14:38 Subject: [PATCH] Fixed bug where the banner message was syntax highlighted when the frontend connected to a new kernel. --- diff --git a/IPython/frontend/qt/console/console_widget.py b/IPython/frontend/qt/console/console_widget.py index 2b8ad2d..3df7f01 100644 --- a/IPython/frontend/qt/console/console_widget.py +++ b/IPython/frontend/qt/console/console_widget.py @@ -216,13 +216,13 @@ class ConsoleWidget(QtGui.QWidget): pass return False - def clear(self, keep_input=False): + def clear(self, keep_input=True): """ Clear the console, then write a new prompt. If 'keep_input' is set, restores the old input buffer when the new prompt is written. """ - self._control.clear() if keep_input: input_buffer = self.input_buffer + self._control.clear() self._show_prompt() if keep_input: self.input_buffer = input_buffer @@ -1074,12 +1074,6 @@ class ConsoleWidget(QtGui.QWidget): self._reading_callback = lambda: \ callback(self.input_buffer.rstrip('\n')) - def _reset(self): - """ Clears the console and resets internal state variables. - """ - self._control.clear() - self._executing = self._reading = False - def _set_continuation_prompt(self, prompt, html=False): """ Sets the continuation prompt. diff --git a/IPython/frontend/qt/console/frontend_widget.py b/IPython/frontend/qt/console/frontend_widget.py index f177b15..8995cf8 100644 --- a/IPython/frontend/qt/console/frontend_widget.py +++ b/IPython/frontend/qt/console/frontend_widget.py @@ -239,7 +239,7 @@ class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin): """ Called when the KernelManager channels have started listening or when the frontend is assigned an already listening KernelManager. """ - self._reset() + self._control.clear() self._append_plain_text(self._get_banner()) self._show_interpreter_prompt() @@ -247,8 +247,8 @@ class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin): """ Called when the KernelManager channels have stopped listening or when a listening KernelManager is removed from the frontend. """ - # FIXME: Print a message here? - pass + self._executing = self._reading = False + self._highlighter.highlighting_on = False #--------------------------------------------------------------------------- # 'FrontendWidget' interface