Replacement for jupyter-conn-id

This commit is contained in:
Nathaniel Nicandro 2020-05-07 16:27:16 -05:00
parent dc91912d5b
commit 3e40fde7ec
2 changed files with 10 additions and 3 deletions

View file

@ -67,9 +67,6 @@ connected to.")
(cl-defmethod jupyter-stop ((io function) &optional _channel)
(jupyter-send io 'stop))
(defun jupyter-conn-id (conn)
(funcall (jupyter-connection-id conn)))
;;;; `jupyter-connection'
(cl-defgeneric jupyter-connection (thing)

View file

@ -49,6 +49,16 @@
"Return non-nil if KERNEL has been launched."
(and (jupyter-kernel-session kernel) t))
(cl-defmethod cl-print-object ((kernel jupyter-kernel) stream)
(princ (format "#<jupyter-kernel %s%s>"
(jupyter-kernelspec-name (jupyter-kernel-spec kernel))
(if (jupyter-alive-p kernel)
(concat " " (truncate-string-to-width
(jupyter-session-id (jupyter-kernel-session kernel))
9 nil nil ""))
""))
stream))
(cl-defgeneric jupyter-kernel (&rest args)
"Return a kernel constructed from ARGS.
ARGS are keyword arguments used to initialize the returned