Commit graph

97 commits

Author SHA1 Message Date
John Miller
4f5f29d351 ein-jupyterhub: Fix websocket connects.
Made sure to add the right cookies to the websocket request. Websockets
authenticate and everything is peachy now.
2017-07-25 16:57:32 -05:00
John Miller
9a1579d5f6 ein-jupyterhub: Support contents api
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.
2017-07-25 15:36:07 -05:00
John Miller
4b92b3adcc ein-kernel: Support (anew) starting kernels in older versions of jupyter.
Overzealously looking to the future was my sin here.
2017-05-18 09:04:49 -05:00
John Miller
91b5f605ee Implementat company doc-buffer command.
ein company backend will now show results of inspect_request in a company
documentation buffer when company requests documentation via the doc-buffer
command.
2017-04-21 17:57:16 -05:00
John Miller
d13e85b370 Minimally functional company-mode support.
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.
2017-04-19 10:12:45 -05:00
John Miller
f0f0c0d206 Typos, more efficient kernelspec querying.
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).
2017-04-11 17:09:30 -05:00
John Miller
39f5d329f1 Functional tests start jupyter using ein:jupyter-server-start
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??
2017-04-07 08:18:41 -05:00
John Miller
8cb69fe4e7 Update to latest sessions API
Set POST body during session creation per
http://jupyter-api.surge.sh/#!/sessions/get_sessions.
2017-03-16 22:28:17 -05:00
John Miller
1b3aa10d51 Properly detect set_next_input payloads.
With this change %load magic works correctly.
2016-12-18 23:09:07 -06:00
John Miller
2b7b9f20fa Improving ipdb support.
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.
2016-11-29 22:06:03 -06:00
John Miller
c70dee7733 Taceback from cell edit buffer, more informative version
Jump to tracebacks from cell edit buffers.

Slightly more informative on version of jupyter we are working with.
2016-11-05 17:49:52 -05:00
John Miller
19303cb637 Fix notebooklist render, remove connect_request
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.
2016-10-29 09:43:40 -05:00
John Miller
586879598a Switch kernel in running notebook.
Does so by changing kernelspec and restarting notebook.
2016-08-26 20:52:54 -05:00
John Miller
8aaae29a23 Fix what introducing kernelspecs broke.
Embarassing, really. Missing parameters and some poorly placed branching
logic conspired to bring down ein on IPython 2.x. Should be better now.
2016-04-15 16:08:53 -05:00
John Miller
8efa954308 Account for when url-or-port is an integer
For determining websocket protocol, if url-or-port is an integer don't
need to check if it contains `https://`.
2016-03-30 21:38:33 -05:00
John Miller
847d4a0d3e closes #81
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.
2016-03-30 21:32:14 -05:00
John Miller
90920e28c6 Create notebooks with user-specified kernels.
This works with the New Notebook widget in the notebooklist,
need to check if the menu commands also work.
2016-01-13 08:30:15 -06:00
John Miller
a89aa6aebd Including kernelspecs into the notebooklist view.
EIN now shows kernels available for the Jupyter server being view in the
notebooklist buffer. We don't do much with the info, yet, though.
2016-01-13 07:52:02 -06:00
John Miller
447854fdac Query Jupyter for kernelspecs
Structures and logic for querying Jupyter server for a list of available
kernelspecs.
2016-01-11 09:20:40 -07:00
John Miller
0bbe7ad204 Be more friendly in ein:notebooklist-open
Accept URL's even if protocol not specified. If no protocol is specified
then assume http.
2015-07-08 16:17:54 -05:00
John Miller
e76251f8ef Fix for #63
EIN didn't know how to generate websocket URL's for remote hosts. It
does now.
2015-07-08 13:37:09 -05:00
John Miller
6d667f630a Fix typo in ein:kernel-del. 2015-07-08 13:10:45 -05:00
John Miller
488bb67f09 Add kernel reconnect command, fix restart.
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.
2015-07-05 22:27:52 -05:00
Diego Berrocal
8d02d8b6e4 Important fix, there is a g where there shouldn't be.
This goes into the MELPA version, making it unusable
2015-05-28 14:19:09 -05:00
John Miller
0cf283a43b Use session query to show running kernels.
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.
2015-05-28 11:56:40 -05:00
John Miller
81583c4411 API for querying active sessions, don't kill session on closing buffer. 2015-05-27 21:49:48 -05:00
John Miller
a4c6892551 Support set-buffer-file-name
In support of fixing issues #46 and #47.
2015-05-15 23:23:56 -05:00
John Miller
d2681d88e3 Proper implementation of #42, fix restart-kernel command.
Can jump to notebook cells from traceback buffer, kernel restart command
works on both IPython 2.x and 3.x.
2015-05-12 15:12:33 -05:00
John Miller
39513afd1e Working in 2.x again.
Those if blocks can by pretty iffy. Har. Har . Har. It's late.
2015-05-04 23:36:47 -05:00
John Miller
fe4950cbb7 Correctly start sessions in ipython 3.x
Now start sessions correctly (I think) in IPython 3.x, but somehow this
seems to break IPython 2.x.
2015-05-04 22:59:18 -05:00
John Miller
c488bfb020 Detect ipdb vs pdb, handle debugger output.
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).
2015-04-10 13:59:36 -05:00
John Miller
1d6c26bbf6 Merge remote-tracking branch 'origin/stdin-channel'
Conflicts:
	lisp/ein-ipdb.el
	lisp/ein-kernel.el
2015-04-09 08:15:23 -05:00
John Miller
bf11f775c2 Getting closer. 2015-04-07 06:51:37 -05:00
John Miller
29e1d7e077 Experiment with comint.
Doing as a first step towards integration with gud...
2015-04-06 13:34:42 -05:00
John Miller
04d36b3fa1 Bump version.
May also have fixed some indentation issues as ein-python was meant for
an old version of python.el.
2015-04-06 12:20:46 -05:00
John Miller
ab8ad81c51 Revert "Separate ipdb buffer, basic command loop."
This reverts commit 33522fcb8d.
2015-04-06 12:14:45 -05:00
John Miller
33522fcb8d Separate ipdb buffer, basic command loop. 2015-04-06 07:23:09 -05:00
John Miller
faaa578807 Basic support for ipdb sessions.
Similar to support in web interface; interaction with debugger is sent
to cell output. We can do better.
2015-03-31 17:26:00 -05:00
John Miller
1c73f2b016 Support stdin input_request for password 2015-03-31 16:55:14 -05:00
John Miller
0328ee70aa Fix silly typo.
It was silly.
2015-03-18 14:09:44 -05:00
John Miller
f41549cd2e Fix `KeyError: 'detail_level' with IPython 3.0
Some more problems with inspect_request messages that I thought I fixed
in earlier commits.

Also some typo fixin' and link correctin'.
2015-03-17 20:41:31 -05:00
John Miller
7b57db59bd Fix execute_reply payload processing in IPython 3.0
The message format for execute_reply payloads has changed. Seems the API
for this is still not finalized, but at least the pager works when I do
things like `object_name?`.
2015-01-14 18:36:59 -06:00
John Miller
b1f4c017e7 Support single websocket with multiple channels
With IPython 3.0 we now support multiplexed communication over a single
websocket. At the moment iopub and shell are supported; stdin doesn't
seem to be working yet (not sure if it needs to be, though).
2015-01-14 17:07:28 -06:00
John Miller
5cdb7ca907 Do connect-request on initial connect
Not sure if we need to do this, or what purpose it might serve, but
seems more appropriate than sending a kernel_info_request when opening
websocket channels.

Also make message handler kernel inactive error messages more
informative.
2014-11-16 11:49:02 -06:00
John Miller
30564f8eda Include session when opening websocket.
Ipython 3.0-dev has been complaining for a while that ein doesn't
specify a session-id when opening a websocket channel to a notebook.
2014-11-16 08:12:04 -06:00
John Miller
228d97f397 Fixing nasty mismatch in saved notebook v4 format
There is a nasty mismatch between internal representation of cell
outputs in ein and for cell outputs in notebook v4.

The current solution is less than elegant, but seems to work. Need more
testing!
2014-11-13 21:36:43 -06:00
John Miller
59072658aa IPython 3.0 Support
Maybe, just maybe ein now works under both IPython 2.x and IPython 3.0
(or what is the development version as of this commit). And by works I
mean open, closing, saving notebooks and communicating with the IPython
kernel. It is good.

Also fixed a bug in kernelinfo - os.uname is not implemented in Windows
(or mac, probably), but I think socket.gethostname() is available on all
three platforms.
2014-10-22 21:35:20 -05:00
John Miller
f39c57a633 Directory bugfix. First steps in IPython 3.0 support.
Fixed bug in accessing directories a depths greater than 1 level.

Some initial support for IPython 3.0 and IPEP 27. Can open notebooklists
and notebooks, but having some issues connecting to websocket.
2014-10-17 16:44:04 -05:00
gcr
9c90f25e5a Handle pager opening
Before, this fork has a small regression: Typing 'thing?' into the shell does not open the pager. This small change fixes this small regression.
2014-05-23 15:21:16 -04:00
millejoh
3b0498655c Support kernel reset operations. 2014-05-10 12:59:03 -05:00