Commit graph

36 commits

Author SHA1 Message Date
dickmao
bead667ee0 Clean up multilang
Do not assume python... leverage ESS to improve R interaction.
Fix both undo and fontify in the presence of toggling cells (`C-c
C-t`)
Fix and test switching kernels
2018-12-08 21:25:48 -05:00
dickmao
f0984eab55 jupyterhub basic (PAM only)
`ein:login` or `ein:notebooklist-login` is the preferred way to access
jupyterhub, although `ein:jupyterhub-connect` is still autoloaded.
2018-12-04 18:31:44 -05:00
dickmao
20cf261a8e fixes #399 2018-11-09 14:50:16 -05:00
dickmao
0490031ec8 Sane File Navigation
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).
2018-10-26 18:40:19 -04:00
dickmao
6e3a062e98 travis is a harsh taskmaster 2018-10-17 17:45:19 -04:00
John Miller
7bc6e88e5c ein-query: More debug messages, try harder not to get stuck.
Logging to see what the heck is going on, and something of a failsafe to
continue execution in the case things get really stuck.
2018-10-12 15:31:33 -05:00
John Miller
0212845c6d ein-query: Fix syntax error in loop.
Also tuning as stress testing is showing some problems with my intial solution.
2018-10-12 14:03:22 -05:00
John Miller
b36f33e76c ein-query: Fix #345.
This should keep too many calls to `request' from occurring at the same time.
Not sure I like blocking while waiting for previous calls to terminate, but for
the moment this seems the easiest solution without going the full deferred route
on `ein:query-singleton-ajax' and wrapping calls with semaphore checks via
concurrent.
2018-10-12 11:34:44 -05:00
dickmao
11c2245c41 Asynchronize all server communication
Use deferred and callbacks instead of `:sync t` for tkf requests which
is known to have issues.  Query server attributes once on
notebooklist-open to avoid sequencing issue #176 (but allow Resync).
Under curl backend, a second request for the same "key" as a pending
request will abort the latter, which has resulted in a clobbered
curl-cookie-jar file, so merely warn and don't abort.

Fix #176
2018-10-07 00:40:48 -04:00
Tomasz Mieszkowski
f29f0a3293 Don't strip existing headers in ein:query-prepare-header
This change fixes the issue where notebook being saved is sent to Jupyter with
`Content-Type: application/x-www-form-urlencoded`, because the default value of
this header (`application/json`) gets wiped out in `ein:query-prepare-header`.

The above issue becomes more apparent when notebook contains non-ascii
characters - in such case Jupyter logs a warning: `Invalid x-www-form-urlencoded
body: 'latin-1' codec can't encode characters in position XXX: ordinal not in
range(256)`.
2018-06-24 17:54:20 +02:00
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
e2078e8951 ein-jupyterhub: Code to authroize a user with jupyterhub.
`ein:jupyterhub-connect' will take a url for the jupyterhub server, a user, and
a password and then get and store the authorization token for that user.

Big things on the way!
2017-07-21 12:36:07 -05:00
John Miller
21925e8122 ein-jupyterhub: Early success getting version and authentication token
Some initial success querying jupyterhub for the version and getting an
authentication token for a user.
2017-07-20 18:25:40 -05:00
John Miller
d3a40af574 Add auto-complete as a required dependency.
It seems that in some instances EIN is failing to install on emacs installations
that do not have auto-complete, so for the moment I am making auto-complete a
required package.

If this causes you a problem please log an issue on the project issues page
(https://github.com/millejoh/emacs-ipython-notebook/issues) and let me know
what is happening on your system.
2017-06-16 13:17:11 -05:00
John Miller
ed9c0cf606 Fix for issue #162.
Add X-XSRFTOKEN header when cookie is present. See notes for notebook
[v4.3.1](https://blog.jupyter.org/2016/12/21/jupyter-notebook-4-3-1/).
2017-01-03 20:11:28 -06:00
John Miller
90c7e4501f Try to fix blocking call warning
According to the internet this is because we need a `with-local-quit` at
the right time and place.
2016-10-09 12:45:32 -05:00
John Miller
9182acc258 NBFormat v4 Tweaks, fixing rename-notebook
Renaming notebooks should work a bit better now, tweaked code for saving
nbformat v4 to correctly include execution_count parameter even if cell
has not been executed.

Cleaned up some silliness in ein:query-singleton-ajax.
2014-11-11 11:33:14 -06:00
John Miller
849adda708 Support for nbformat v4
BEWARE! This is a large commit and the code here is still mostly
untested. Back up your notebooks before giving this changeset a try with
the current IPython-dev version.

Given that, ein is now able to open and save basic notebooks saved in
nbformat 4. Still haven't tested more complex notebooks with embedded
images.
2014-11-07 19:28:09 -06:00
gcr
1914e68b89 Encode URL before opening it
This fixes the bug where EIN cannot open notebooks with spaces in them.

I'm not sure if this is correct!
2014-05-23 15:24:48 -04:00
Takafumi Arakaki
7901e90db7 Default ein:query-timeout is nil if curl is used
this is to address #114
2013-06-11 16:51:06 +02:00
Takafumi Arakaki
8409fa14ad Fix timeout handling in ein:query-singleton-ajax 2012-12-29 19:36:53 +01:00
Takafumi Arakaki
84ea2748fb Remove unused functions from ein-query.el 2012-12-29 19:32:43 +01:00
Takafumi Arakaki
e58ce1413e Use request-cookie-string 2012-12-29 19:30:00 +01:00
Takafumi Arakaki
9e3be6c954 Rewrite ein:query-singleton-ajax using request 2012-12-29 18:55:06 +01:00
Takafumi Arakaki
1f29b6d91e Workaround url.el bug for proper message after login 2012-12-17 19:26:13 +01:00
Takafumi Arakaki
041873b18f Better POST handling when DATA is given to ein:query-ajax 2012-12-17 17:39:46 +01:00
Takafumi Arakaki
a4c7e6d00d Add ein:query-get-cookie 2012-12-17 17:39:46 +01:00
Takafumi Arakaki
0576e54486 Log url-http-method when querying 2012-12-04 11:04:46 +01:00
Takafumi Arakaki
fc386d3647 Better error logging in ein:query-ajax--parse-data 2012-09-19 01:24:03 +02:00
Takafumi Arakaki
25f67b9874 Refactor ein-query.el: better debugging message 2012-09-18 22:46:10 +02:00
Takafumi Arakaki
ca8c1678fe (require 'ein-utils) -> (require 'ein-core) 2012-08-28 15:26:32 +02:00
Takafumi Arakaki
7ca779e836 Move ein:with-live-buffer to ein-utils.el 2012-08-19 12:44:00 +02:00
Takafumi Arakaki
71ec80da82 Rename: ein:query... -> ein:%query-ajax-canceled%
%s/\_<ein:\(query-ajax-canceled\)\_>/ein:%\1%/g
2012-08-18 23:00:51 +02:00
Takafumi Arakaki
b044aca6b7 Rename: ein:query... -> ein:%query-ajax-timer%
%s/\_<ein:\(query-ajax-timer\)\_>/ein:%\1%/g
2012-08-18 23:00:24 +02:00
Takafumi Arakaki
d1031fd61e mv *ein*.el ein.py lisp/
fixes #6
2012-07-02 16:47:20 +02:00
Renamed from ein-query.el (Browse further)