Show More
@@ -369,8 +369,7 class ConsoleWidget(QtGui.QPlainTextEdit): | |||
|
369 | 369 | 'keep_input' is set, restores the old input buffer when the new |
|
370 | 370 | prompt is written. |
|
371 | 371 | """ |
|
372 | super(ConsoleWidget, self).clear() | |
|
373 | ||
|
372 | QtGui.QPlainTextEdit.clear(self) | |
|
374 | 373 | input_buffer = '' |
|
375 | 374 | if self._reading: |
|
376 | 375 | self._reading = False |
@@ -1,5 +1,6 | |||
|
1 | 1 | # Standard library imports |
|
2 | 2 | import signal |
|
3 | import sys | |
|
3 | 4 | |
|
4 | 5 | # System library imports |
|
5 | 6 | from pygments.lexers import PythonLexer |
@@ -256,6 +257,13 class FrontendWidget(HistoryConsoleWidget): | |||
|
256 | 257 | self._complete_pos = self.textCursor().position() |
|
257 | 258 | return True |
|
258 | 259 | |
|
260 | def _get_banner(self): | |
|
261 | """ Gets a banner to display at the beginning of a session. | |
|
262 | """ | |
|
263 | banner = 'Python %s on %s\nType "help", "copyright", "credits" or ' \ | |
|
264 | '"license" for more information.' | |
|
265 | return banner % (sys.version, sys.platform) | |
|
266 | ||
|
259 | 267 | def _get_context(self, cursor=None): |
|
260 | 268 | """ Gets the context at the current cursor location. |
|
261 | 269 | """ |
@@ -280,7 +288,11 class FrontendWidget(HistoryConsoleWidget): | |||
|
280 | 288 | def _started_channels(self): |
|
281 | 289 | """ Called when the kernel manager has started listening. |
|
282 | 290 | """ |
|
283 | self.clear() | |
|
291 | QtGui.QPlainTextEdit.clear(self) | |
|
292 | if self._reading: | |
|
293 | self._reading = False | |
|
294 | self.appendPlainText(self._get_banner()) | |
|
295 | self._show_prompt() | |
|
284 | 296 | |
|
285 | 297 | def _stopped_channels(self): |
|
286 | 298 | """ Called when the kernel manager has stopped listening. |
@@ -2,6 +2,7 | |||
|
2 | 2 | from PyQt4 import QtCore, QtGui |
|
3 | 3 | |
|
4 | 4 | # Local imports |
|
5 | from IPython.core.usage import default_banner | |
|
5 | 6 | from frontend_widget import FrontendWidget |
|
6 | 7 | |
|
7 | 8 | |
@@ -51,6 +52,15 class IPythonWidget(FrontendWidget): | |||
|
51 | 52 | self.execute('run %s' % path, hidden=hidden) |
|
52 | 53 | |
|
53 | 54 | #--------------------------------------------------------------------------- |
|
55 | # 'FrontendWidget' protected interface | |
|
56 | #--------------------------------------------------------------------------- | |
|
57 | ||
|
58 | def _get_banner(self): | |
|
59 | """ Reimplemented to a return IPython's default banner. | |
|
60 | """ | |
|
61 | return default_banner | |
|
62 | ||
|
63 | #--------------------------------------------------------------------------- | |
|
54 | 64 | # 'IPythonWidget' interface |
|
55 | 65 | #--------------------------------------------------------------------------- |
|
56 | 66 |
General Comments 0
You need to be logged in to leave comments.
Login now