Show More
@@ -91,7 +91,7 b' class IPythonWidget(FrontendWidget):' | |||||
91 | _PromptBlock = namedtuple('_PromptBlock', ['block', 'length', 'number']) |
|
91 | _PromptBlock = namedtuple('_PromptBlock', ['block', 'length', 'number']) | |
92 | _payload_source_edit = zmq_shell_source + '.edit_magic' |
|
92 | _payload_source_edit = zmq_shell_source + '.edit_magic' | |
93 | _payload_source_exit = zmq_shell_source + '.ask_exit' |
|
93 | _payload_source_exit = zmq_shell_source + '.ask_exit' | |
94 |
_payload_source_ |
|
94 | _payload_source_next_input = zmq_shell_source + '.set_next_input' | |
95 | _payload_source_page = 'IPython.zmq.page.page' |
|
95 | _payload_source_page = 'IPython.zmq.page.page' | |
96 |
|
96 | |||
97 | #--------------------------------------------------------------------------- |
|
97 | #--------------------------------------------------------------------------- | |
@@ -107,7 +107,7 b' class IPythonWidget(FrontendWidget):' | |||||
107 | self._payload_source_edit : self._handle_payload_edit, |
|
107 | self._payload_source_edit : self._handle_payload_edit, | |
108 | self._payload_source_exit : self._handle_payload_exit, |
|
108 | self._payload_source_exit : self._handle_payload_exit, | |
109 | self._payload_source_page : self._handle_payload_page, |
|
109 | self._payload_source_page : self._handle_payload_page, | |
110 |
self._payload_source_ |
|
110 | self._payload_source_next_input : self._handle_payload_next_input } | |
111 | self._previous_prompt_obj = None |
|
111 | self._previous_prompt_obj = None | |
112 | self._keep_kernel_on_exit = None |
|
112 | self._keep_kernel_on_exit = None | |
113 |
|
113 | |||
@@ -459,9 +459,9 b' class IPythonWidget(FrontendWidget):' | |||||
459 | self._keep_kernel_on_exit = item['keepkernel'] |
|
459 | self._keep_kernel_on_exit = item['keepkernel'] | |
460 | self.exit_requested.emit() |
|
460 | self.exit_requested.emit() | |
461 |
|
461 | |||
462 |
def _handle_payload_ |
|
462 | def _handle_payload_next_input(self, item): | |
463 |
# Simpl |
|
463 | # Simply store the text for now. It is written to the buffer when | |
464 |
# |
|
464 | # _show_interpreter_prompt is called. | |
465 | self._code_to_load = item['text'] |
|
465 | self._code_to_load = item['text'] | |
466 |
|
466 | |||
467 | def _handle_payload_page(self, item): |
|
467 | def _handle_payload_page(self, item): |
@@ -592,9 +592,14 b' class ZMQInteractiveShell(InteractiveShell):' | |||||
592 | content = response.read() |
|
592 | content = response.read() | |
593 | else: |
|
593 | else: | |
594 | content = open(arg_s).read() |
|
594 | content = open(arg_s).read() | |
|
595 | self.set_next_input(content) | |||
|
596 | ||||
|
597 | def set_next_input(self, text): | |||
|
598 | """Send the specified text to the frontend to be presented at the next | |||
|
599 | input cell.""" | |||
595 | payload = dict( |
|
600 | payload = dict( | |
596 |
source='IPython.zmq.zmqshell.ZMQInteractiveShell. |
|
601 | source='IPython.zmq.zmqshell.ZMQInteractiveShell.set_next_input', | |
597 |
text= |
|
602 | text=text | |
598 | ) |
|
603 | ) | |
599 | self.payload_manager.write_payload(payload) |
|
604 | self.payload_manager.write_payload(payload) | |
600 |
|
605 |
General Comments 0
You need to be logged in to leave comments.
Login now