Show More
@@ -65,13 +65,16 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||
|
65 | 65 | """ |
|
66 | 66 | ) |
|
67 | 67 | gui_completion = Bool(False, config=True, |
|
68 | help="Use a list widget instead of plain text output for tab completion." | |
|
68 | help=""" | |
|
69 | Use a list widget instead of plain text output for tab completion. | |
|
70 | """ | |
|
69 | 71 | ) |
|
70 | 72 | # NOTE: this value can only be specified during initialization. |
|
71 | 73 | kind = Enum(['plain', 'rich'], default_value='plain', config=True, |
|
72 | 74 | help=""" |
|
73 |
The type of underlying text widget to use. Valid values are 'plain', |
|
|
74 |
specifies a QPlainTextEdit, and 'rich', which specifies a |
|
|
75 | The type of underlying text widget to use. Valid values are 'plain', | |
|
76 | which specifies a QPlainTextEdit, and 'rich', which specifies a | |
|
77 | QTextEdit. | |
|
75 | 78 | """ |
|
76 | 79 | ) |
|
77 | 80 | # NOTE: this value can only be specified during initialization. |
@@ -84,7 +87,8 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||
|
84 | 87 | 'hsplit' : When paging is requested, the widget is split |
|
85 | 88 | horizontally. The top pane contains the console, and the |
|
86 | 89 | bottom pane contains the paged text. |
|
87 |
'vsplit' : Similar to 'hsplit', except that a vertical splitter |
|
|
90 | 'vsplit' : Similar to 'hsplit', except that a vertical splitter | |
|
91 | used. | |
|
88 | 92 | 'custom' : No action is taken by the widget beyond emitting a |
|
89 | 93 | 'custom_page_requested(str)' signal. |
|
90 | 94 | 'none' : The text is written directly to the console. |
@@ -508,7 +512,7 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||
|
508 | 512 | """ |
|
509 | 513 | self._html_exporter.export() |
|
510 | 514 | |
|
511 | def _get_input_buffer(self): | |
|
515 | def _get_input_buffer(self, force=False): | |
|
512 | 516 | """ The text that the user has entered entered at the current prompt. |
|
513 | 517 | |
|
514 | 518 | If the console is currently executing, the text that is executing will |
@@ -516,7 +520,7 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||
|
516 | 520 | """ |
|
517 | 521 | # If we're executing, the input buffer may not even exist anymore due to |
|
518 | 522 | # the limit imposed by 'buffer_size'. Therefore, we store it. |
|
519 | if self._executing: | |
|
523 | if self._executing and not force: | |
|
520 | 524 | return self._input_buffer_executing |
|
521 | 525 | |
|
522 | 526 | cursor = self._get_end_cursor() |
@@ -1628,7 +1632,8 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||
|
1628 | 1632 | self._control.setReadOnly(False) |
|
1629 | 1633 | self._control.setAttribute(QtCore.Qt.WA_InputMethodEnabled, True) |
|
1630 | 1634 | |
|
1631 |
self._ |
|
|
1635 | if not self._reading: | |
|
1636 | self._executing = False | |
|
1632 | 1637 | self._prompt_started_hook() |
|
1633 | 1638 | |
|
1634 | 1639 | # If the input buffer has changed while executing, load it. |
@@ -1671,11 +1676,11 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||
|
1671 | 1676 | self._reading_callback = None |
|
1672 | 1677 | while self._reading: |
|
1673 | 1678 | QtCore.QCoreApplication.processEvents() |
|
1674 | return self.input_buffer.rstrip('\n') | |
|
1679 | return self._get_input_buffer(force=True).rstrip('\n') | |
|
1675 | 1680 | |
|
1676 | 1681 | else: |
|
1677 | 1682 | self._reading_callback = lambda: \ |
|
1678 | callback(self.input_buffer.rstrip('\n')) | |
|
1683 | callback(self._get_input_buffer(force=True).rstrip('\n')) | |
|
1679 | 1684 | |
|
1680 | 1685 | def _set_continuation_prompt(self, prompt, html=False): |
|
1681 | 1686 | """ Sets the continuation prompt. |
General Comments 0
You need to be logged in to leave comments.
Login now