ecukes clear kernel connect message

This commit is contained in:
dickmao 2020-03-14 00:31:37 -04:00
parent 53ab1c34f3
commit a0943af912
3 changed files with 9 additions and 6 deletions

View file

@ -118,5 +118,5 @@ Scenario: Test ein:on-kernel-connect-functions abnormal hooks
Given I set the kernel connect message
Given new python notebook
And I wait for the smoke to clear
And I switch to buffer "*Messages*"
Then I should see "Hello ein."
Then I should see message "Hello ein"
And I clear the kernel connect message

View file

@ -2,9 +2,12 @@
(lambda ()
(insert-char 37)))
(When "^I set the kernel connect message$"
(lambda ()
(add-to-list 'ein:on-kernel-connect-functions #'(lambda (_) (message "Hello ein.")))))
(When "^I \\(set\\|clear\\) the kernel connect message$"
(lambda (which)
(if (string= which "clear")
(setq ein:on-kernel-connect-functions nil)
(add-to-list 'ein:on-kernel-connect-functions
(apply-partially #'message "Hello ein")))))
(When "^I type session port \\([0-9]+\\)$"
(lambda (port)

View file

@ -299,7 +299,7 @@ See https://github.com/ipython/ipython/pull/3307"
(let* ((websocket (websocket-client-data ws))
(kernel (ein:$websocket-kernel websocket)))
(when (ein:kernel-live-p kernel)
(ein:log 'verbose "ein:start-single-websocket: Running on-connect abnormal hooks.")
(ein:log 'debug "ein:start-single-websocket: Running on-connect abnormal hooks.")
(run-hook-with-args 'ein:on-kernel-connect-functions kernel)
(when cb
(funcall cb kernel)))