Commit bd768e25 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

kernel: Obtain and display channel info from the inferior.

* guix-jupyter-kernel.scm (reply-for-channels): Add #:profile parameter
and honor it.
(reply-execute-request): Call 'inferior-eval' and pass #:profile to
'reply-for-channels'.
parent 3a19cffe
......@@ -174,12 +174,17 @@ NAME with MANIFEST."
channels)))))
(define* (reply-for-channels kernel message channels
#:key (count 0))
"Reply to MESSAGE, which comes from KERNEL, that we successfully switch to
CHANNELS."
(reply-html kernel message
(sxml->html-string (channels->shtml channels))
count))
#:key profile (count 0))
"Reply to MESSAGE, which comes from KERNEL, that we successfully switched
to CHANNELS in PROFILE."
(let ((instances (if profile
(match (profile-channels profile)
(() channels)
(lst lst))
channels)))
(reply-html kernel message
(sxml->html-string (channels->shtml instances))
count)))
(define* (reply-for-channel-failure kernel message channels error
#:key (count 0))
......@@ -409,10 +414,13 @@ stripped."
;; TODO: Send a message showing that something's happening.
(catch 'git-error
(lambda ()
(let ((inferior (inferior-for-channels channels)))
;; TODO: Obtain the <channel-instance> records so the message
;; can provide more info.
(let* ((inferior (inferior-for-channels channels))
(profile (inferior-eval '(begin
(use-modules (guix describe))
(current-profile))
inferior)))
(reply-for-channels kernel message channels
#:profile profile
#:count count)
(set-proxy-state-inferior (increment-execution-count state)
inferior)))
......
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