Show More
@@ -700,6 +700,49 b" socket with the names 'stdin' and 'stdin_reply'. This will allow other clients" | |||||
700 | to monitor/display kernel interactions and possibly replay them to their user |
|
700 | to monitor/display kernel interactions and possibly replay them to their user | |
701 | or otherwise expose them. |
|
701 | or otherwise expose them. | |
702 |
|
702 | |||
|
703 | Representation Data | |||
|
704 | ------------------- | |||
|
705 | ||||
|
706 | This type of message is used to bring back representations (text, html, svg, | |||
|
707 | etc.) of Python objects to the frontend. Each message can have multiple | |||
|
708 | representations of the object; it is up to the frontend to decide which to use | |||
|
709 | and how. A single message should contain the different representations of a | |||
|
710 | single Python object. Each representation should be a JSON'able data structure, | |||
|
711 | and should be a valid MIME type. | |||
|
712 | ||||
|
713 | Some questions remain about this design: | |||
|
714 | ||||
|
715 | * Do we use this message type for pyout/displayhook? | |||
|
716 | * What is the best way to organize the content dict of the message? | |||
|
717 | ||||
|
718 | Message type: ``repr_data``:: | |||
|
719 | ||||
|
720 | # Option 1: if we only allow a single source. | |||
|
721 | content = { | |||
|
722 | 'source' : str # Who create the data | |||
|
723 | 'data' : dict # {'mimetype1' : data1, 'mimetype2' : data2} | |||
|
724 | 'metadata' : dict # Any metadata that describes the data | |||
|
725 | } | |||
|
726 | ||||
|
727 | # Option 2: allowing for a different source for each representation, | |||
|
728 | but not keyed by anything. | |||
|
729 | content = { | |||
|
730 | 'data' = [(source, type, data), (source, type, data)] | |||
|
731 | 'metadata' = dict | |||
|
732 | } | |||
|
733 | ||||
|
734 | # Option 3: like option 2, but keyed by the MIME types. | |||
|
735 | content = { | |||
|
736 | 'data' = {'mimetype1' : (source, data), 'mimetype2' : (source, data)} | |||
|
737 | 'metadata' = dict | |||
|
738 | } | |||
|
739 | ||||
|
740 | # Option 4: like option 2, but keyed by the source. | |||
|
741 | content = { | |||
|
742 | 'data' = {'source' : (mimetype, data), 'source' : (mimetype, data)} | |||
|
743 | 'metadata' = dict | |||
|
744 | } | |||
|
745 | ||||
703 | Python inputs |
|
746 | Python inputs | |
704 | ------------- |
|
747 | ------------- | |
705 |
|
748 | |||
@@ -708,8 +751,7 b' These messages are the re-broadcast of the ``execute_request``.' | |||||
708 | Message type: ``pyin``:: |
|
751 | Message type: ``pyin``:: | |
709 |
|
752 | |||
710 | content = { |
|
753 | content = { | |
711 | # Source code to be executed, one or more lines |
|
754 | 'code' : str # Source code to be executed, one or more lines | |
712 | 'code' : str |
|
|||
713 | } |
|
755 | } | |
714 |
|
756 | |||
715 | Python outputs |
|
757 | Python outputs |
General Comments 0
You need to be logged in to leave comments.
Login now