@@ -407,8 +407,24 @@ def _handle_kernel_info_reply(self, msg):
407
407
if adapt_version != major_protocol_version :
408
408
self .session .adapt_version = adapt_version
409
409
410
+ def is_complete (self , code ):
411
+ """Ask the kernel whether some code is complete and ready to execute."""
412
+ msg = self .session .msg ('is_complete_request' , {'code' : code })
413
+ self .shell_channel .send (msg )
414
+ return msg ['header' ]['msg_id' ]
415
+
416
+ def input (self , string ):
417
+ """Send a string of raw input to the kernel.
418
+
419
+ This should only be called in response to the kernel sending an
420
+ ``input_request`` message on the stdin channel.
421
+ """
422
+ content = dict (value = string )
423
+ msg = self .session .msg ('input_reply' , content )
424
+ self .stdin_channel .send (msg )
425
+
410
426
def shutdown (self , restart = False ):
411
- """Request an immediate kernel shutdown.
427
+ """Request an immediate kernel shutdown on the control channel .
412
428
413
429
Upon receipt of the (empty) reply, client code can safely assume that
414
430
the kernel has shut down and it's safe to forcefully terminate it if
@@ -428,21 +444,4 @@ def shutdown(self, restart=False):
428
444
self .control_channel .send (msg )
429
445
return msg ['header' ]['msg_id' ]
430
446
431
- def is_complete (self , code ):
432
- """Ask the kernel whether some code is complete and ready to execute."""
433
- msg = self .session .msg ('is_complete_request' , {'code' : code })
434
- self .shell_channel .send (msg )
435
- return msg ['header' ]['msg_id' ]
436
-
437
- def input (self , string ):
438
- """Send a string of raw input to the kernel.
439
-
440
- This should only be called in response to the kernel sending an
441
- ``input_request`` message on the stdin channel.
442
- """
443
- content = dict (value = string )
444
- msg = self .session .msg ('input_reply' , content )
445
- self .stdin_channel .send (msg )
446
-
447
-
448
447
KernelClientABC .register (KernelClient )
0 commit comments