Show More
@@ -31,9 +31,10 b' from IPython.frontend.prefilterfrontend import PrefilterFrontEnd' | |||
|
31 | 31 | |
|
32 | 32 | #_COMMAND_BG = '#FAFAF1' # Nice green |
|
33 | 33 | _RUNNING_BUFFER_BG = '#FDFFD3' # Nice yellow |
|
34 | _ERROR_BG = '#FFF1F1' # Nice red | |
|
34 | 35 | |
|
35 | 36 | _RUNNING_BUFFER_MARKER = 31 |
|
36 | ||
|
37 | _ERROR_MARKER = 30 | |
|
37 | 38 | |
|
38 | 39 | #------------------------------------------------------------------------------- |
|
39 | 40 | # Classes to implement the Wx frontend |
@@ -61,6 +62,9 b' class IPythonWxController(PrefilterFrontEnd, ConsoleWidget):' | |||
|
61 | 62 | # Marker for running buffer. |
|
62 | 63 | self.MarkerDefine(_RUNNING_BUFFER_MARKER, stc.STC_MARK_BACKGROUND, |
|
63 | 64 | background=_RUNNING_BUFFER_BG) |
|
65 | # Marker for tracebacks. | |
|
66 | self.MarkerDefine(_ERROR_MARKER, stc.STC_MARK_BACKGROUND, | |
|
67 | background=_ERROR_BG) | |
|
64 | 68 | |
|
65 | 69 | |
|
66 | 70 | |
@@ -122,7 +126,7 b' class IPythonWxController(PrefilterFrontEnd, ConsoleWidget):' | |||
|
122 | 126 | end_line = self.current_prompt_line \ |
|
123 | 127 | + max(1, len(raw_string.split('\n'))-1) |
|
124 | 128 | for i in range(self.current_prompt_line, end_line): |
|
125 |
self.MarkerAdd(i, |
|
|
129 | self.MarkerAdd(i, _RUNNING_BUFFER_MARKER) | |
|
126 | 130 | # Update the display: |
|
127 | 131 | wx.Yield() |
|
128 | 132 | ## Remove the trailing "\n" for cleaner display |
@@ -137,6 +141,15 b' class IPythonWxController(PrefilterFrontEnd, ConsoleWidget):' | |||
|
137 | 141 | if hasattr(self, '_cursor'): |
|
138 | 142 | del self._cursor |
|
139 | 143 | |
|
144 | ||
|
145 | def show_traceback(self): | |
|
146 | start_line = self.GetCurrentLine() | |
|
147 | PrefilterFrontEnd.show_traceback(self) | |
|
148 | wx.Yield() | |
|
149 | for i in range(start_line, self.GetCurrentLine()): | |
|
150 | self.MarkerAdd(i, _ERROR_MARKER) | |
|
151 | ||
|
152 | ||
|
140 | 153 | #-------------------------------------------------------------------------- |
|
141 | 154 | # Private API |
|
142 | 155 | #-------------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now