Commit 0b9fec78 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

messages: Add <execute-reply> and <execute-result>.

* jupyter/messages.scm (<kernel-info-reply>)[help-links]: Reverse on
return.
(<execute-reply>, <execute-result>): New record types.
parent a038906c
......@@ -81,6 +81,7 @@
kernel-status->json
execute-input?
execute-input
execute-input-code
execute-input-counter
json->execute-input
......@@ -94,7 +95,25 @@
execute-request-allow-stdin?
execute-request-stop-on-error?
json->execute-request
execute-request->json))
execute-request->json
execute-reply?
execute-reply
execute-reply-status
execute-reply-counter
execute-reply-exception-name
execute-reply-exception-value
execute-reply-traceback
json->execute-reply
execute-reply->json
execute-result?
execute-result
execute-result-counter
execute-result-data
execute-result-metadata
json->execute-result
execute-result->json))
;;; Commentary:
;;;
......@@ -315,7 +334,7 @@ This is a low-level procedure for internal use."
(banner kernel-info-reply-banner
(default ""))
(help-links kernel-info-reply-help-links
(json "help_links")
(json "help_links" identity reverse) ;XXX: !
(default '())))
(define-json-mapping <kernel-status> kernel-status
......@@ -348,3 +367,31 @@ This is a low-level procedure for internal use."
(json "allow_stdin") (default #t))
(stop-on-error? execute-request-stop-on-error?
(json "stop_on_error") (default #f)))
(define-json-mapping <execute-reply> execute-reply
make-execute-reply
execute-reply?
json->execute-reply <=> execute-reply->json
(status execute-reply-status
(json "status" string->symbol symbol->string)
(default 'ok))
(counter execute-reply-counter
(json "execution_count"))
;; TODO: Add 'payload' and 'user_expressions'.
;; The following fields are for status = 'error.
(exception-name execute-reply-exception-name
(json "ename") (default #f))
(exception-value execute-reply-exception-value
(json "evalue") (default #f))
(traceback execute-reply-traceback
(json "traceback" vector->list list->vector)
(default '())))
(define-json-mapping <execute-result> execute-result
make-execute-result
execute-result?
json->execute-result <=> execute-result->json
(counter execute-result-counter)
(data execute-result-data (default '())) ;alist
(metadata execute-result-metadata (default '()))) ;alist
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment