ein-notebooklist: Fix check for multiple servers on same port.

If `notebook list` returns more than one entry for the same url:port the
resulting structure won't be a list of lists, but rather a list of multiple
paired elements.
This commit is contained in:
John Miller 2018-10-23 09:02:17 -05:00
parent e693a53e5a
commit ab8f881bff

View file

@ -201,8 +201,8 @@ port the instance is running on."
(defun ein:crib-token (url-or-port) (defun ein:crib-token (url-or-port)
(ein:aif (gethash url-or-port (ein:crib-token--all-local-tokens)) (ein:aif (gethash url-or-port (ein:crib-token--all-local-tokens))
(if (listp (car it)) (if (> (length it) 2)
(let ((token (read-passwd "There are multiple jupyter servers registered on the same url! Please check which is the right one and enter the token here:"))) (let ((token (read-passwd "I see multiple jupyter servers registered on the same url! Please enter the token for one that is actually running: ")))
(list :json-false token)) (list :json-false token))
it) it)
(list nil nil))) (list nil nil)))