mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 23:41:38 -05:00
Replace uses of jupyter-clients
This function is used elsewhere.
This commit is contained in:
parent
b5fac750e3
commit
2d807d8670
4 changed files with 4 additions and 8 deletions
|
@ -311,15 +311,11 @@ method is called."
|
|||
(jupyter-alive-p kernel)
|
||||
(jupyter-alive-p (jupyter-io kernel)))))
|
||||
|
||||
(cl-defmethod jupyter-clients ()
|
||||
"Return a list of all `jupyter-kernel-client' objects."
|
||||
(jupyter-all-objects 'jupyter--clients))
|
||||
|
||||
(defun jupyter-find-client-for-session (session-id)
|
||||
"Return the kernel client whose session has SESSION-ID."
|
||||
(or (cl-find-if
|
||||
(lambda (x) (string= (jupyter-session-id (oref x session)) session-id))
|
||||
(jupyter-clients))
|
||||
(jupyter-all-objects 'jupyter--clients))
|
||||
(error "No client found for session (%s)" session-id)))
|
||||
|
||||
;;; Client local variables
|
||||
|
|
|
@ -1914,7 +1914,7 @@ If MODE is non-nil, return all REPL buffers whose
|
|||
|
||||
If FIRST is non-nil, only return the first REPL buffer that matches."
|
||||
(cl-loop
|
||||
for client in (jupyter-clients)
|
||||
for client in (jupyter-all-objects 'jupyter--clients)
|
||||
for match =
|
||||
(when (and (object-of-class-p client 'jupyter-repl-client)
|
||||
(buffer-live-p (oref client buffer)))
|
||||
|
|
|
@ -172,7 +172,7 @@ CLIENT must be communicating with a `jupyter-server-kernel', see
|
|||
"Return a kernel manager managing kernel with ID on SERVER.
|
||||
Return nil if none could be found."
|
||||
(cl-loop
|
||||
for client in (jupyter-clients)
|
||||
for client in (jupyter-all-objects 'jupyter--clients)
|
||||
thereis (let ((manager (oref client manager)))
|
||||
(and (cl-typep manager 'jupyter-server-kernel-manager)
|
||||
(pcase-let (((cl-struct jupyter-server-kernel server id)
|
||||
|
|
|
@ -656,7 +656,7 @@ see the documentation on the --NotebookApp.password argument."
|
|||
(ignore-errors (delete-directory jupyter-test-temporary-directory))
|
||||
(ignore-errors (delete-process (car jupyter-test-notebook)))
|
||||
(cl-loop
|
||||
for client in (jupyter-clients)
|
||||
for client in (jupyter-all-objects 'jupyter--clients)
|
||||
do (ignore-errors (jupyter-shutdown-kernel client)))
|
||||
(cl-loop for server in (jupyter-servers)
|
||||
do (ignore-errors (jupyter-ioloop-stop (oref server ioloop))))
|
||||
|
|
Loading…
Add table
Reference in a new issue