Show More
@@ -61,7 +61,7 b' class InProcessKernelTestCase(unittest.TestCase):' | |||
|
61 | 61 | |
|
62 | 62 | kc = BlockingInProcessKernelClient(kernel=kernel) |
|
63 | 63 | kernel.frontends.append(kc) |
|
64 |
kc |
|
|
64 | kc.execute('print("bar")') | |
|
65 | 65 | msg = get_stream_message(kc) |
|
66 | 66 | self.assertEqual(msg['content']['text'], 'bar\n') |
|
67 | 67 |
@@ -463,7 +463,7 b' class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):' | |||
|
463 | 463 | self.kernel_client.iopub_channel.flush() |
|
464 | 464 | |
|
465 | 465 | def callback(line): |
|
466 |
self.kernel_client. |
|
|
466 | self.kernel_client.input(line) | |
|
467 | 467 | if self._reading: |
|
468 | 468 | self.log.debug("Got second input request, assuming first was interrupted.") |
|
469 | 469 | self._reading = False |
@@ -225,7 +225,7 b' class HistoryConsoleWidget(ConsoleWidget):' | |||
|
225 | 225 | return self._history[-n:] |
|
226 | 226 | |
|
227 | 227 | def _request_update_session_history_length(self): |
|
228 |
msg_id = self.kernel_client. |
|
|
228 | msg_id = self.kernel_client.execute('', | |
|
229 | 229 | silent=True, |
|
230 | 230 | user_expressions={ |
|
231 | 231 | 'hlen':'len(get_ipython().history_manager.input_hist_raw)', |
@@ -203,7 +203,7 b' class IPythonWidget(FrontendWidget):' | |||
|
203 | 203 | self._retrying_history_request = True |
|
204 | 204 | # wait out the kernel's queue flush, which is currently timed at 0.1s |
|
205 | 205 | time.sleep(0.25) |
|
206 |
self.kernel_client |
|
|
206 | self.kernel_client.history(hist_access_type='tail',n=1000) | |
|
207 | 207 | else: |
|
208 | 208 | self._retrying_history_request = False |
|
209 | 209 | return |
@@ -296,12 +296,11 b' class IPythonWidget(FrontendWidget):' | |||
|
296 | 296 | # The reply will trigger %guiref load provided language=='python' |
|
297 | 297 | self.kernel_client.kernel_info() |
|
298 | 298 | |
|
299 |
self.kernel_client |
|
|
300 | n=1000) | |
|
299 | self.kernel_client.history(hist_access_type='tail', n=1000) | |
|
301 | 300 | |
|
302 | 301 | def _load_guiref_magic(self): |
|
303 | 302 | """Load %guiref magic.""" |
|
304 |
self.kernel_client |
|
|
303 | self.kernel_client.execute('\n'.join([ | |
|
305 | 304 | "try:", |
|
306 | 305 | " _usage", |
|
307 | 306 | "except:", |
@@ -385,7 +384,7 b' class IPythonWidget(FrontendWidget):' | |||
|
385 | 384 | """ |
|
386 | 385 | # If a number was not specified, make a prompt number request. |
|
387 | 386 | if number is None: |
|
388 |
msg_id = self.kernel_client |
|
|
387 | msg_id = self.kernel_client.execute('', silent=True) | |
|
389 | 388 | info = self._ExecutionRequest(msg_id, 'prompt') |
|
390 | 389 | self._request_info['execute'][msg_id] = info |
|
391 | 390 | return |
@@ -36,7 +36,7 b' class ZMQCompleter(IPCompleter):' | |||
|
36 | 36 | |
|
37 | 37 | # send completion request to kernel |
|
38 | 38 | # Give the kernel up to 0.5s to respond |
|
39 |
msg_id = self.client. |
|
|
39 | msg_id = self.client.complete( | |
|
40 | 40 | code=line, |
|
41 | 41 | cursor_pos=cursor_pos, |
|
42 | 42 | ) |
@@ -157,8 +157,8 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):' | |||
|
157 | 157 | # flush stale replies, which could have been ignored, due to missed heartbeats |
|
158 | 158 | while self.client.shell_channel.msg_ready(): |
|
159 | 159 | self.client.shell_channel.get_msg() |
|
160 |
# |
|
|
161 |
msg_id = self.client |
|
|
160 | # execute takes 'hidden', which is the inverse of store_hist | |
|
161 | msg_id = self.client.execute(cell, not store_history) | |
|
162 | 162 | |
|
163 | 163 | # first thing is wait for any side effects (output, stdin, etc.) |
|
164 | 164 | self._executing = True |
@@ -399,7 +399,7 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):' | |||
|
399 | 399 | # only send stdin reply if there *was not* another request |
|
400 | 400 | # or execution finished while we were reading. |
|
401 | 401 | if not (self.client.stdin_channel.msg_ready() or self.client.shell_channel.msg_ready()): |
|
402 |
self.client. |
|
|
402 | self.client.input(raw_data) | |
|
403 | 403 | |
|
404 | 404 | def mainloop(self, display_banner=False): |
|
405 | 405 | while True: |
@@ -414,7 +414,7 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):' | |||
|
414 | 414 | # handling seems rather unpredictable... |
|
415 | 415 | self.write("\nKeyboardInterrupt in interact()\n") |
|
416 | 416 | |
|
417 |
self.client. |
|
|
417 | self.client.shutdown() | |
|
418 | 418 | |
|
419 | 419 | def _banner1_default(self): |
|
420 | 420 | return "IPython Console {version}\n".format(version=release.version) |
General Comments 0
You need to be logged in to leave comments.
Login now