Coursera appears to kill websockets every minute or so, and I'm
observing firsthand the buggy behaviors described in #356. This PR
cleans up the websocket code and kernel restart logic. Removed
backwards compatibility for the v2 messaging api
as keeping it in the presence of the refactoring would make it more
broken that it already was.
One line change to fix header not updating after cell execution
(keeps saying "Kernel is busy").
The bug does not manifest when running with `ein:debug` true since
EMACS's display loop updates more frequently with debug messages.
In tracking this bug, noticed eldoc support isn't quite there.
`__import__('ein').print_object_info_for(%s)` appears in
`ein-completer` and `ein-pytools`, and is invalid python syntax
afaict. Took a few steps to make it whole, but incomplete.
As emacs users we prefer and have the luxury of fuzzy file navigation
via ido and projectile. From a notebook or notebooklist buffer, the commands
`C-c C-f` ein:file-open
`C-c C-o` ein:notebook-open
offer an ido alternative to point and click navigation.
To populate the ido lists, retrieving the content hierarchy is on by
default. Two custom variables determine how wide and deep the content query
probes (currently at 2 levels deep and 6 directories wide). Set both
to zero to turn off.
tkf half finished code to quickly go from local file buffers to notebook
mode via `C-c C-z` or `C-c C-o`. This is now possible. EIN will
start the server from a suitable parent directory of the visited file.
Enable ido completion for `notebooklist-login`.
Remove the albatross `ein-loaddefs.el` in favor of more standard
`ein-autoloads.el` that is not git tracked.
Convenience `make install` from git source (local alternative to
melpa).
New hooks `ein:pre-kernel-execute-functions', `ein:on-execute-reply-functions'
and `ein:on-shell-reply-functions'. See variable documentation for more
information.
When running against jupyterhub master (which will someday be v0.8) can know log
in and make calls to the contents api.
Everything is working except for opening websocket connections.
It seems there are enough people out there still on Emacs 24 to warrant undoing
some of my recent moves away from eieio to cl-generic. For the near future I
will try to keep any changes that are incompatible with Emacs 24 to a
development branch. There is still probably plenty of opportunity to make the
code more future-proof for an eventual move away from eieio (I'm looking at you
oref and sref...)
ein company backend will now show results of inspect_request in a company
documentation buffer when company requests documentation via the doc-buffer
command.
There is now a company mode backend for ein. It generates completions by sending
complete_request to the running kernel so for the moment no jedi integration.
Configuring is maybe non-obvious - user should at minimum set
`ein:use-auto-complete` and `ein:use-auto-complete-superpack` to nil. Adding a
`(require 'ein-company)` probably should be done somewhere in the user's init
file. This could all be done better so I will attempt to address in later
commits.
Silly typo in ein-kernel.el. Querying kernelspecs is slightly more efficient,
caching results when url is a string or port (previously just cached results for
ports).
This reduces some of the complexity in testein.py, but unfortunately running
tests is still unreliable. Running batchwise tests don't work at all in Windows,
and running from inside emacs tests often need to be run multiple times before
they pass.
The worst offender is the delete notebook test, which will pass on usually only
1 out of 3 tries.
Testing seems to have revealed a couple bugs, so win??
EIN ipdb buffer should look better on Linux machines now. The extra characters
were someone's (ipython?) attempt at doing ansi coloring I think.
Also trying to make the ipdb comint buffer more canonical, with the hope to get
it to work with realgud. Not quite there yet, unfortunately.
Notebooklist was not showing kernel status anymore.
Connect_request messages are deprecated since v5.0 of the messaging
spec, and ein never did much anyway with the message.
This works by detecting if 'https:' appears in the url-or-port string,
which will be the case if you call `ein:notebooklist-open` using https:
+ url + port.
Note also that on windows, at least, I get SSL errors when using curl as
request backend. Using url-retrieve eliminates the errors and SSL access
works as advertised.
New commend `ein:notebook-reconnect-kernel` which will close then reopen
the websocket connection to a running kernel - without killing the
kernel.
Was not correctly killing and restarting the kernel in
`ein:kernel-restart.`
Fixed `ein-restart-kernel` to use REST API to kill kernel, then
restart/reconnect, again using the REST API.
Got rid of the `ein:kernel-stop` function. Seems confusing to have
'stop' and 'kill' methods running around.
Stopping a kernel now doesn't automatically close a buffer, nor does
closing a buffer automatically stop a running kernel. This is
functionality more in line of what EIN supported for IPython 0.x and
1.x.
Somehow lost ability to handle iopub responses when debugger session is
running.
Also try to set prompt in comint buffer to match debugger being called
(ipdb vs. pdb).