Commit graph

73 commits

Author SHA1 Message Date
dickmao
54cb27701f remove longstanding recursive requires workaround 2020-02-29 22:35:49 -05:00
dickmao
d902f1fbc0 reassert ignorance of redirects
As the reasons for the redirect seem to be lost in time, and as
@noonker points out in #635 the redirect logic wasn't correct and
stymied file saves, we retry removing the redirect as initially suggested in #370.
2020-02-04 20:02:29 -05:00
dickmao
4467a25ad9 syntax-multiline was not way to go 2020-01-17 14:17:46 -05:00
dickmao
f9dfd390af expand-file-name on read-directory 2020-01-15 14:16:28 -05:00
dickmao
05b7cfbbf8 ein:urls 2020-01-15 12:42:43 -05:00
dickmao
ba530cfa95 before embedding notebooklist reloader into ein:notebook-open 2020-01-13 11:38:21 -05:00
dickmao
702f04064a :image/png not :png 2020-01-11 16:03:54 -05:00
dickmao
8a545c508b close notebook on delete 2020-01-10 23:58:51 -05:00
dickmao
c10f4a93b0 able to connect to gke 2020-01-05 18:16:05 -05:00
dickmao
f7180405d6 makes test 2020-01-02 20:09:42 -05:00
dickmao
e12a33588d replace ein:aif with aif 2019-11-24 00:17:52 -05:00
dickmao
d0d13c8277 get 25.1 to compile 2019-11-13 17:46:50 -05:00
dickmao
49a1c54b00 compile properly (very suspect :mode slot misspecifications in poly-ein) 2019-11-13 13:54:29 -05:00
dickmao
bcf1c2ac55 purge
purge

align pm:get-span no major mode error with diagnostic

purge
2019-11-08 16:05:11 -05:00
Sam Steingold
7cb4f91f7e fix#560: request-response-status-code may return nil 2019-06-21 09:39:03 -04:00
dickmao
e491ac6f1c Ob-ein Improvements
Bring the org offering to feature parity.
2019-05-20 10:59:43 -04:00
dickmao
234cf391f9 Polymode
M-x customize-group RET ein
Toggle Ein:Polymode

Avoid trying to emulate jump-to-definition, eldoc, and autocompletion
functionalities that Elpy will always do better.

Fixes #497 #482 #418
2019-04-02 09:35:17 -04:00
dickmao
0f7f8b14cd Test C-c ' 2019-02-20 11:50:46 -05:00
dickmao
ed6482096e Add ob-ein tests
Also, speed up login and other cleanups
2019-02-19 10:06:15 -05:00
John Miller
50b9a8d134 ob-ein: Better output for babel.
Greg Sexton clearly knows his way around org better than I. For async execution
make sure we insert results "the org way."
2019-02-17 21:10:08 -06:00
dickmao
e328e86105 Clarify what notebook version means
Say `Contents API 5.7.4` instead of `Notebook v5` in notebooklist.

EIN doesn't care about the python version (2.7, 3.5) or the
ipython version (5.8.0, 6.2.1).  The "jupyter notebook contents api"
version (currently at 5.7.4) is the thing that matters.
2018-12-25 10:59:18 -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
9f1ed02895 retry more times under travis 2018-12-02 17:23:55 -05:00
dickmao
d621944797 Clean up websocket callbacks
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.
2018-10-31 23:38:45 -04:00
dickmao
80839a1d77 finish previous commit 2018-10-28 14:38:53 -04:00
dickmao
aaeffa4596 end deferred chain on bad login 2018-10-28 13:48:53 -04: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
16cb32a1a6 more request-curl callback protections 2018-10-20 21:37:47 -04:00
dickmao
0345ed0b33 Try to address windows NT unseen. Add osx. Add ipython 7.0.1. 2018-10-20 00:12:34 -04:00
dickmao
bc10cea743 Normalize url-or-port
```
"http://localhost:8888"
"http://localhost:8888/"
"http://127.0.0.1:8888"
"http://127.0.0.1:8888/"
"8888"
8888
```

Ideally these should converge to the same thing.  Since many hash
tables are keyed off `url-or-port`, forgetting to
normalize `url-or-port` with `ein:url` leads to missed cache hits and
general malaise.  So we try to do that.

Address a FIXME: apply callbacks to `ein:notebook-list-login-and-open`.

Removed py3.5 from travis build matrix to reduce developer strain.
2018-10-12 21:55:33 -05:00
John Miller
5e7548d457 Prettify indentation in ein-contents.el
I work mostly from laptops with small screens and long function calls all on one
line can be hard to read, so I split things up a bit.
2018-10-12 11:33:20 -05:00
dickmao
3f1d9f3737 ein:flatten runs out of stack on big directories; also don't wait on files 2018-10-07 03:15:49 -04: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
dickmao
ad8408dfb7 Implement undo
`M-x customize-group RET ein`
Toggle `Ein:Worksheet Enable Undo`
Save for Future Sessions
Restart emacs or kill/restart notebook

Fixes #338
2018-10-02 10:00:25 -04:00
John Miller
baec3d8577 ein-notebooklist: Fix #278. 2018-03-08 14:08:45 -06:00
John Miller
7a4d58ea36 ein-notebook: Try to suspend GC operations when loading notebooks.
Loading large notebooks (>1M) can be slow. At least some of this is due to
downloading from the jupyter server, but this operation is asynchronous and
should not block emacs. My suspicion is that when Emacs blocks it is when it is
generating the internal data structures used to represent the notebook in emacs.
This is somewhat unavoidable, but part of the slow down may be due to reaching
the cons threshold. These changes try to temporarily increase the cons threshold
while loading the notebook. We'll see if it helps at all.
2018-03-08 09:03:09 -06:00
John Miller
4419818dde Merge branch 'back-to-eieio' 2017-07-29 23:08:35 -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
c78711a7c4 Back to eieio
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...)
2017-07-12 14:38:04 -05:00
John Miller
88595dede6 Support filetypes other than ipynb
EIN now lists other file types in notebooklist buffer and will allow user to
open those files for editing. The new buffer will get the right major-mode most
of the time, but has a hard time getting the line coding right on Windows
platform.
2017-04-20 07:47:05 -05:00
John Miller
d189d8b924 Implement uploads per #170. 2017-04-02 14:33:56 -05:00
John Miller
3fc73b98d8 Attempt at workaround for curl cookie jar issues
Login and notebooklist requests have a tendency to fail with the curl request
backend when there is no cookie jar file. Request will create the cookiejar, but
apparently with the asynchronous nature of ein this happens too slowly causing
content REST queries to fail. My tactic here is to repeat the call once, and
only once when a failure is detected. It is a difficult problem to reliably
create so I'm not sure if this is a good fix or not. Time will tell.
2017-02-17 15:06:59 -06:00
John Miller
4e482cafd9 Stop being so clever with error handling. Stepping away from eieio.
Automatically calling ein:notebooklist-login when a content API calls is a BAD
IDEA. Much better to warn and suggest, and if debugging is enabled throw the
error so hopefully a backtrace can be generated.

Taking some initial steps away from eieio and towards cl-generic.
2017-02-01 09:25:47 -06:00
John Miller
e226b30139 Follow redirects, numerous other fixes.
Content api tries to handle redirects, pointing new content towards the
redirected url instead of the one supplied by the user. Login with redirects not
working, though.

Other fixes:

 - Fixed bug in ein-ac that was generating errors outside of ein buffers.
 - New function `ein:pyools-set-figure-size` as shortcut for modifying
   matplotlib figsize rcParam.
 - ob-ein will output tracebacks when ein source block generates an error.
2017-01-11 07:42:06 -06:00
John Miller
06eb2eea2c Cleanup, better error handling, remove request cookie defadvice.
tkf/emacs-request#60 was recently fixed, so no longer need to defadvice
`request--netscape-cookie-parse. Changed names of some obsolete variables. Also
trying to be a bit more clever in error handling by judicious use of
condition-case.
2016-12-22 12:19:52 -06:00
Sam Steingold
bb81d08065 require all dependencies
provide this feature before requiring ein-notebook to avoid
the circular dependency error
2016-12-05 09:14:41 -05:00
John Miller
262dbca88a The actual encoding fix.
Sigh.
2016-12-01 21:12:43 -06:00
John Miller
02b790665b Fix (maybe) encoding issues when saving notebooks.
This hopefully fixes issues #142 and #133.
2016-12-01 21:10:20 -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