travis buttressing

This commit is contained in:
dickmao 2019-02-19 15:29:18 -05:00
parent ed6482096e
commit 2f19904fe7
3 changed files with 30 additions and 30 deletions

View file

@ -119,9 +119,9 @@
(When "^new \\(.+\\) notebook$"
(lambda (kernel)
(multiple-value-bind (url-or-port token) (ein:jupyter-server-conn-info)
(lexical-let (notebook)
(let (notebook)
(with-current-buffer (ein:notebooklist-get-buffer url-or-port)
(lexical-let ((ks (ein:get-kernelspec url-or-port kernel)))
(let ((ks (ein:get-kernelspec url-or-port kernel)))
(setq notebook (ein:testing-new-notebook url-or-port ks))))
(let ((buf-name (format ein:notebook-buffer-name-template
(ein:$notebook-url-or-port notebook)

View file

@ -368,7 +368,7 @@ This function is called via `ein:notebook-after-rename-hook'."
(ein:content-upload nb-path upload-path)))
;;;###autoload
(defun ein:notebooklist-new-notebook (url-or-port kernelspec &optional callback no-pop)
(defun ein:notebooklist-new-notebook (url-or-port kernelspec &optional callback no-pop retry)
(interactive (list (ein:notebooklist-ask-url-or-port)
(ido-completing-read
"Select kernel: "
@ -386,18 +386,18 @@ This function is called via `ein:notebook-after-rename-hook'."
:data (json-encode '((:type . "notebook")))
:parser #'ein:json-read
:error (apply-partially #'ein:notebooklist-new-notebook-error
url-or-port path callback)
:success (apply-partially #'ein:notebooklist-new-notebook-callback
url-or-port kernelspec path callback no-pop retry)
:success (apply-partially #'ein:notebooklist-new-notebook-success
url-or-port kernelspec path callback no-pop))))
(defun* ein:notebooklist-new-notebook-callback (url-or-port
kernelspec
path
callback
no-pop
&key
data
&allow-other-keys)
(defun* ein:notebooklist-new-notebook-success (url-or-port
kernelspec
path
callback
no-pop
&key
data
&allow-other-keys)
(let ((nbname (plist-get data :name))
(nbpath (plist-get data :path)))
(when (< (ein:notebook-version-numeric url-or-port) 3)
@ -408,19 +408,15 @@ This function is called via `ein:notebook-after-rename-hook'."
(ein:notebooklist-open* url-or-port path)))
(defun* ein:notebooklist-new-notebook-error
(url-or-port callback
&key response &allow-other-keys
&aux
(error (request-response-error-thrown response))
(dest (request-response-url response)))
(ein:log 'verbose
"NOTEBOOKLIST-NEW-NOTEBOOK-ERROR url-or-port: %S; error: %S; dest: %S"
url-or-port error dest)
(ein:log 'error
"Failed to open new notebook (error: %S). \
You may find the new one in the notebook list." error)
(ein:notebooklist-open* url-or-port nil nil (lambda (buffer url-or-port)
(pop-to-buffer buffer))))
(url-or-port kernelspec path callback no-pop retry
&key symbol-status error-thrown &allow-other-keys)
(let ((notice (format "ein:notebooklist-new-notebook-error: %s %s"
symbol-status error-thrown)))
(if retry
(ein:log 'error notice)
(ein:log 'info notice)
(sleep-for 0 1500)
(ein:notebooklist-new-notebook url-or-port kernelspec callback no-pop t))))
;;;###autoload
(defun ein:notebooklist-new-notebook-with-name

View file

@ -93,7 +93,7 @@ if I call this between links in a deferred chain. Adding a flush-queue."
continue)
(error "Timeout: %s" predicate))))
(defun ein:testing-new-notebook (url-or-port ks)
(defun ein:testing-new-notebook (url-or-port ks &optional retry)
(lexical-let (notebook)
(condition-case err
(progn
@ -109,9 +109,13 @@ if I call this between links in a deferred chain. Adding a flush-queue."
(ein:kernel-live-p it))))
nil 10000 1000)
notebook)
(error (ein:log 'error "ein:testing-new-notebook: [%s] %s"
url-or-port (error-message-string err))
nil))))
(error (let ((notice (format "ein:testing-new-notebook: [%s] %s"
url-or-port (error-message-string err))))
(if retry
(progn (ein:log 'error notice) nil)
(ein:log 'info notice)
(sleep-for 0 1500)
(ein:testing-new-notebook url-or-port ks t)))))))
(defadvice ert-run-tests-batch (after ein:testing-dump-logs-hook activate)
"Hook `ein:testing-dump-logs-hook' because `kill-emacs-hook'