##// END OF EJS Templates
fixes to completion and connect messages
MinRK -
Show More
@@ -451,7 +451,6 b" When status is 'abort', there are for now no additional data fields. This"
451 happens when the kernel was interrupted by a signal.
451 happens when the kernel was interrupted by a signal.
452
452
453
453
454
455 Object information
454 Object information
456 ------------------
455 ------------------
457
456
@@ -466,12 +465,12 b' Message type: ``object_info_request``::'
466
465
467 content = {
466 content = {
468 # The (possibly dotted) name of the object to be searched in all
467 # The (possibly dotted) name of the object to be searched in all
469 # relevant namespaces
468 # relevant namespaces
470 'name' : str,
469 'oname' : str,
471
470
472 # The level of detail desired. The default (0) is equivalent to typing
471 # The level of detail desired. The default (0) is equivalent to typing
473 # 'x?' at the prompt, 1 is equivalent to 'x??'.
472 # 'x?' at the prompt, 1 is equivalent to 'x??'.
474 'detail_level' : int,
473 'detail_level' : int,
475 }
474 }
476
475
477 The returned information will be a dictionary with keys very similar to the
476 The returned information will be a dictionary with keys very similar to the
@@ -526,16 +525,16 b' Message type: ``object_info_reply``::'
526 # objects, this field is empty.
525 # objects, this field is empty.
527 'argspec' : { # The names of all the arguments
526 'argspec' : { # The names of all the arguments
528 args : list,
527 args : list,
529 # The name of the varargs (*args), if any
528 # The name of the varargs (*args), if any
530 varargs : str,
529 varargs : str,
531 # The name of the varkw (**kw), if any
530 # The name of the varkw (**kw), if any
532 varkw : str,
531 varkw : str,
533 # The values (as strings) of all default arguments. Note
532 # The values (as strings) of all default arguments. Note
534 # that these must be matched *in reverse* with the 'args'
533 # that these must be matched *in reverse* with the 'args'
535 # list above, since the first positional args have no default
534 # list above, since the first positional args have no default
536 # value at all.
535 # value at all.
537 defaults : list,
536 defaults : list,
538 },
537 },
539
538
540 # For instances, provide the constructor signature (the definition of
539 # For instances, provide the constructor signature (the definition of
541 # the __init__ method):
540 # the __init__ method):
@@ -570,30 +569,44 b' Message type: ``complete_request``::'
570
569
571 content = {
570 content = {
572 # The text to be completed, such as 'a.is'
571 # The text to be completed, such as 'a.is'
573 'text' : str,
572 # this may be an empty string if the frontend does not do any lexing,
574
573 # in which case the kernel must figure out the completion
575 # The full line, such as 'print a.is'. This allows completers to
574 # based on 'line' and 'cursor_pos'.
576 # make decisions that may require information about more than just the
575 'text' : str,
577 # current word.
576
578 'line' : str,
577 # The full line, such as 'print a.is'. This allows completers to
579
578 # make decisions that may require information about more than just the
580 # The entire block of text where the line is. This may be useful in the
579 # current word.
581 # case of multiline completions where more context may be needed. Note: if
580 'line' : str,
582 # in practice this field proves unnecessary, remove it to lighten the
581
583 # messages.
582 # The entire block of text where the line is. This may be useful in the
583 # case of multiline completions where more context may be needed. Note: if
584 # in practice this field proves unnecessary, remove it to lighten the
585 # messages.
584
586
585 'block' : str,
587 'block' : str or null/None,
586
588
587 # The position of the cursor where the user hit 'TAB' on the line.
589 # The position of the cursor where the user hit 'TAB' on the line.
588 'cursor_pos' : int,
590 'cursor_pos' : int,
589 }
591 }
590
592
591 Message type: ``complete_reply``::
593 Message type: ``complete_reply``::
592
594
593 content = {
595 content = {
594 # The list of all matches to the completion request, such as
596 # The list of all matches to the completion request, such as
595 # ['a.isalnum', 'a.isalpha'] for the above example.
597 # ['a.isalnum', 'a.isalpha'] for the above example.
596 'matches' : list
598 'matches' : list,
599
600 # the substring of the matched text
601 # this is typically the common prefix of the matches,
602 # and the text that is already in the block that would be replaced by the full completion.
603 # This would be 'a.is' in the above example.
604 'text' : str,
605
606 # status should be 'ok' unless an exception was raised during the request,
607 # in which case it should be 'error', along with the usual error message content
608 # in other messages.
609 'status' : 'ok'
597 }
610 }
598
611
599
612
@@ -668,21 +681,21 b' Message type: ``connect_request``::'
668 Message type: ``connect_reply``::
681 Message type: ``connect_reply``::
669
682
670 content = {
683 content = {
671 'shell_port' : int # The port the shell ROUTER socket is listening on.
684 'shell_port' : int, # The port the shell ROUTER socket is listening on.
672 'iopub_port' : int # The port the PUB socket is listening on.
685 'iopub_port' : int, # The port the PUB socket is listening on.
673 'stdin_port' : int # The port the stdin ROUTER socket is listening on.
686 'stdin_port' : int, # The port the stdin ROUTER socket is listening on.
674 'hb_port' : int # The port the heartbeat socket is listening on.
687 'hb_port' : int, # The port the heartbeat socket is listening on.
675 }
688 }
676
689
677
690
678 Kernel info
691 Kernel info
679 -----------
692 -----------
680
693
681 If a client needs to know what protocol the kernel supports, it can
694 If a client needs to know information about the kernel, it can
682 ask version number of the messaging protocol supported by the kernel.
695 make a request of the kernel's information.
683 This message can be used to fetch other core information of the
696 This message can be used to fetch core information of the
684 kernel, including language (e.g., Python), language version number and
697 kernel, including language (e.g., Python), language version number and
685 IPython version number.
698 IPython version number, and the IPython message spec version number.
686
699
687 Message type: ``kernel_info_request``::
700 Message type: ``kernel_info_request``::
688
701
@@ -738,9 +751,6 b' Upon their own shutdown, client applications will typically execute a last'
738 minute sanity check and forcefully terminate any kernel that is still alive, to
751 minute sanity check and forcefully terminate any kernel that is still alive, to
739 avoid leaving stray processes in the user's machine.
752 avoid leaving stray processes in the user's machine.
740
753
741 For both shutdown request and reply, there is no actual content that needs to
742 be sent, so the content dict is empty.
743
744 Message type: ``shutdown_request``::
754 Message type: ``shutdown_request``::
745
755
746 content = {
756 content = {
@@ -769,18 +779,13 b' Streams (stdout, stderr, etc)'
769 Message type: ``stream``::
779 Message type: ``stream``::
770
780
771 content = {
781 content = {
772 # The name of the stream is one of 'stdin', 'stdout', 'stderr'
782 # The name of the stream is one of 'stdout', 'stderr'
773 'name' : str,
783 'name' : str,
774
784
775 # The data is an arbitrary string to be written to that stream
785 # The data is an arbitrary string to be written to that stream
776 'data' : str,
786 'data' : str,
777 }
787 }
778
788
779 When a kernel receives a raw_input call, it should also broadcast it on the pub
780 socket with the names 'stdin' and 'stdin_reply'. This will allow other clients
781 to monitor/display kernel interactions and possibly replay them to their user
782 or otherwise expose them.
783
784 Display Data
789 Display Data
785 ------------
790 ------------
786
791
General Comments 0
You need to be logged in to leave comments. Login now