Show More
@@ -64,13 +64,14 b' class IPythonWidget(FrontendWidget):' | |||||
64 | # 'BaseFrontendMixin' abstract interface |
|
64 | # 'BaseFrontendMixin' abstract interface | |
65 | #--------------------------------------------------------------------------- |
|
65 | #--------------------------------------------------------------------------- | |
66 |
|
66 | |||
67 | def _handle_pyout(self, msg): |
|
67 | def _handle_pyout(self, omsg): | |
68 | """ Reimplemented for IPython-style "display hook". |
|
68 | """ Reimplemented for IPython-style "display hook". | |
69 | """ |
|
69 | """ | |
70 | self._append_html(self._make_out_prompt(self._prompt_count)) |
|
70 | prompt_number = omsg['content']['prompt_number'] | |
|
71 | data = omsg['content']['data'] | |||
|
72 | self._append_html(self._make_out_prompt(prompt_number)) | |||
71 | self._save_prompt_block() |
|
73 | self._save_prompt_block() | |
72 |
|
74 | self._append_plain_text(data + '\n') | ||
73 | self._append_plain_text(msg['content']['data'] + '\n') |
|
|||
74 |
|
75 | |||
75 | #--------------------------------------------------------------------------- |
|
76 | #--------------------------------------------------------------------------- | |
76 | # 'FrontendWidget' interface |
|
77 | # 'FrontendWidget' interface | |
@@ -132,37 +133,6 b' class IPythonWidget(FrontendWidget):' | |||||
132 | self._set_continuation_prompt( |
|
133 | self._set_continuation_prompt( | |
133 | self._make_continuation_prompt(self._prompt), html=True) |
|
134 | self._make_continuation_prompt(self._prompt), html=True) | |
134 |
|
135 | |||
135 | #------ Signal handlers ---------------------------------------------------- |
|
|||
136 |
|
||||
137 | def _handle_execute_error(self, reply): |
|
|||
138 | """ Reimplemented for IPython-style traceback formatting. |
|
|||
139 | """ |
|
|||
140 | content = reply['content'] |
|
|||
141 | traceback_lines = content['traceback'][:] |
|
|||
142 | traceback = ''.join(traceback_lines) |
|
|||
143 | traceback = traceback.replace(' ', ' ') |
|
|||
144 | traceback = traceback.replace('\n', '<br/>') |
|
|||
145 |
|
||||
146 | ename = content['ename'] |
|
|||
147 | ename_styled = '<span class="error">%s</span>' % ename |
|
|||
148 | traceback = traceback.replace(ename, ename_styled) |
|
|||
149 |
|
||||
150 | self._append_html(traceback) |
|
|||
151 |
|
||||
152 | def _handle_pyout(self, omsg): |
|
|||
153 | """ Reimplemented for IPython-style "display hook". |
|
|||
154 | """ |
|
|||
155 | # self._append_html(self._make_out_prompt(self._prompt_count)) |
|
|||
156 | # TODO: Also look at the output_sep, output_sep2 keys of content. |
|
|||
157 | # They are used in terminal based frontends to add empty spaces before |
|
|||
158 | # and after the Out[]: prompt. I doubt you want to use them, but they |
|
|||
159 | # are there. I am thinking we should even take them out of the msg. |
|
|||
160 | prompt_number = omsg['content']['prompt_number'] |
|
|||
161 | data = omsg['content']['data'] |
|
|||
162 | self._append_html(self._make_out_prompt(prompt_number)) |
|
|||
163 | self._save_prompt_block() |
|
|||
164 | self._append_plain_text(data + '\n') |
|
|||
165 |
|
||||
166 | #--------------------------------------------------------------------------- |
|
136 | #--------------------------------------------------------------------------- | |
167 | # 'IPythonWidget' interface |
|
137 | # 'IPythonWidget' interface | |
168 | #--------------------------------------------------------------------------- |
|
138 | #--------------------------------------------------------------------------- |
@@ -16,11 +16,6 b' Things to do:' | |||||
16 |
|
16 | |||
17 | # Standard library imports. |
|
17 | # Standard library imports. | |
18 | import __builtin__ |
|
18 | import __builtin__ | |
19 | <<<<<<< HEAD |
|
|||
20 | from code import CommandCompiler |
|
|||
21 | ======= |
|
|||
22 | import os |
|
|||
23 | >>>>>>> 7425745bce7a04ad0dce41b22f03bebe1d2cdd20 |
|
|||
24 | import sys |
|
19 | import sys | |
25 | import time |
|
20 | import time | |
26 | import traceback |
|
21 | import traceback | |
@@ -34,6 +29,7 b' from IPython.utils.traitlets import Instance' | |||||
34 | from completer import KernelCompleter |
|
29 | from completer import KernelCompleter | |
35 | from entry_point import base_launch_kernel, make_argument_parser, make_kernel, \ |
|
30 | from entry_point import base_launch_kernel, make_argument_parser, make_kernel, \ | |
36 | start_kernel |
|
31 | start_kernel | |
|
32 | from iostream import OutStream | |||
37 | from session import Session, Message |
|
33 | from session import Session, Message | |
38 | from zmqshell import ZMQInteractiveShell |
|
34 | from zmqshell import ZMQInteractiveShell | |
39 |
|
35 | |||
@@ -390,7 +386,7 b" given, the GUI backend is matplotlib's, otherwise use one of: \\" | |||||
390 | ['tk', 'gtk', 'qt', 'wx', 'payload-svg'].") |
|
386 | ['tk', 'gtk', 'qt', 'wx', 'payload-svg'].") | |
391 | namespace = parser.parse_args() |
|
387 | namespace = parser.parse_args() | |
392 |
|
388 | |||
393 | kernel = make_kernel(namespace, Kernel) |
|
389 | kernel = make_kernel(namespace, Kernel, OutStream) | |
394 | if namespace.pylab: |
|
390 | if namespace.pylab: | |
395 | if namespace.pylab == 'auto': |
|
391 | if namespace.pylab == 'auto': | |
396 | kernel.activate_pylab() |
|
392 | kernel.activate_pylab() |
General Comments 0
You need to be logged in to leave comments.
Login now