Skip to content

Commit cf91d06

Browse files
committed
Don't cache the server object when retrieving from TRAMP file name
There is no need to cache the server object since `jupyter-server` returns a cached server object already based on the URL passed to it. * jupyter-tramp.el (jupyter-tramp-server-from-file-name): Do it.
1 parent 0df3a28 commit cf91d06

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

jupyter-tramp.el

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -297,25 +297,24 @@ fails."
297297
(unless (jupyter-tramp-file-name-p filename)
298298
(error "Not a Jupyter filename"))
299299
(with-parsed-tramp-file-name filename nil
300-
(with-tramp-connection-property v "server"
301-
(let* ((url (jupyter-tramp-url-from-file-name filename))
302-
(client (jupyter-server :url url)))
303-
(prog1 client
304-
(unless (jupyter-api-server-accessible-p client)
305-
(cond
306-
((y-or-n-p (format "Login to %s using a token? " url))
307-
(jupyter-api-authenticate client 'token))
308-
(t
309-
;; This is here so that reading a password using
310-
;; `tramp-read-passwd' via `jupyter-tramp-read-passwd' will check
311-
;; auth sources.
312-
(tramp-set-connection-property v "first-password-request" t)
313-
(jupyter-api-authenticate client
314-
'password
315-
(let ((remote (file-remote-p filename)))
316-
(lambda ()
317-
(jupyter-tramp-read-passwd
318-
filename (format "Password [%s]: " remote)))))))))))))
300+
(let* ((url (jupyter-tramp-url-from-file-name filename))
301+
(client (jupyter-server :url url)))
302+
(prog1 client
303+
(unless (jupyter-api-server-accessible-p client)
304+
(cond
305+
((y-or-n-p (format "Login to %s using a token? " url))
306+
(jupyter-api-authenticate client 'token))
307+
(t
308+
;; This is here so that reading a password using
309+
;; `tramp-read-passwd' via `jupyter-tramp-read-passwd' will check
310+
;; auth sources.
311+
(tramp-set-connection-property v "first-password-request" t)
312+
(jupyter-api-authenticate client
313+
'password
314+
(let ((remote (file-remote-p filename)))
315+
(lambda ()
316+
(jupyter-tramp-read-passwd
317+
filename (format "Password [%s]: " remote))))))))))))
319318

320319
;;; Getting information about file models
321320

0 commit comments

Comments
 (0)