Properly encode notebook paths

This should fix an obscure (well, at least no one has created an issue
for this yet) failure trying to open a notebook path that contains
characters like (, or ), etc. that need to be escaped in the REST API
call.
This commit is contained in:
John Miller 2015-06-17 12:09:48 -05:00
parent ec9eefb83c
commit aaee6d0348
2 changed files with 248 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -99,13 +99,13 @@ global setting. For global setting and more information, see
(defun ein:content-url (content) (defun ein:content-url (content)
(let ((url-or-port (ein:$content-url-or-port content)) (let ((url-or-port (ein:$content-url-or-port content))
(path (ein:$content-path content))) (path (ein:$content-path content)))
(ein:url url-or-port "api/contents" path))) (ein:url url-or-port "api/contents" (url-hexify-string path))))
(defun ein:content-url-legacy (content) (defun ein:content-url-legacy (content)
"Generate content url's for IPython Notebook version 2.x" "Generate content url's for IPython Notebook version 2.x"
(let ((url-or-port (ein:$content-url-or-port content)) (let ((url-or-port (ein:$content-url-or-port content))
(path (ein:$content-path content))) (path (ein:$content-path content)))
(ein:url url-or-port "api/notebooks" path))) (ein:url url-or-port "api/notebooks" (url-hexify-string path))))
(defun ein:content-query-contents (path &optional url-or-port force-sync callback) (defun ein:content-query-contents (path &optional url-or-port force-sync callback)
"Return the contents of the object at the specified path from the Jupyter server." "Return the contents of the object at the specified path from the Jupyter server."