Commit graph

170 commits

Author SHA1 Message Date
John Miller
6438d078fd Merge branch 'pr-382' 2018-11-05 19:48:30 -06:00
Sam Steingold
0469fd0e35 there may be NO local jupyter installation
(ein:crib-token--all-local-tokens): wrap execution of
  `ein:jupyter-default-server-command' in `condition-case'
2018-11-05 11:46:20 -05:00
dickmao
ee3b0f095c Follow-up to cleaning up websockets
Renaming of functions with better understanding of reconnects.  Under
the original logic, reconnecting blithely created a new session if
the original no longer existed.  Now it will alert the user when this
happens.

Also hopefully fixes #381 as there was a bug of missing argument not
being caught by lisp's undisciplined typing.
2018-11-04 21:38:20 -06: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
c9be1f1120 a quick hack to fix #239 (coursera) that ignores the url-retrieve way
of doing things
2018-10-29 02:00:57 -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
2aa5d004b4 fix a spoonerism 2018-10-26 12:20:07 -04:00
John Miller
ab8f881bff ein-notebooklist: Fix check for multiple servers on same port.
If `notebook list` returns more than one entry for the same url:port the
resulting structure won't be a list of lists, but rather a list of multiple
paired elements.
2018-10-23 09:02:17 -05:00
dickmao
e693a53e5a master fixes
ein:url normalization issue (fails the passworded server test).
"No servers running here" warning is unsettling for I think the
majority of users who do not run jupyter locally.
2018-10-23 02:12:45 -04:00
John Miller
6944fb0a3f ein-notebooklist: Fix format string.
Format string was missing a parameter. Also some doc string cleanup.
2018-10-22 14:52:46 -05:00
John Miller
a26ca7fa7d ein-notebooklist: Fix corner case in token autodetection.
There appears to be a (hopefully very rare) possibility of `jupyter notebook
list --json` returning multiple tokens for the same url. This will result in
some perplexing behavior in ein, so these changes try to bring clarity when such
a situation occurs.
2018-10-22 14:49:45 -05: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
c89a0a8887 it a'int easy being green. 2018-10-18 16:23:49 -04:00
dickmao
6e3a062e98 travis is a harsh taskmaster 2018-10-17 17:45:19 -04:00
dickmao
c5bfb0dca1 expose ein:notebooklist-open as a bonafide function (but obsolete) 2018-10-17 17:24:34 -04:00
dickmao
085a188b20 Streamline login
Merge the login and open commands (open aliased to login).  Add login
tests described in #352.

Attempt to improve user experience by synchronously executing
`ein:jupyter-server-start`.  `ein:dev-prefer-deferred` custom variable
allows easy switch to compare sychronous versus old asynchronous behavior.
2018-10-17 16:52:10 -04:00
dickmao
257331f32c Revert "Normalize url-or-port"
This reverts commit 435d001b03.
2018-10-15 14:13:51 -04:00
dickmao
cea40017fa fix bug 2018-10-15 10:29:11 -04:00
dickmao
435d001b03 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-14 20:36:49 -05:00
dickmao
c888508751 ein-jupyter must require ein-notebooklist but not conversely 2018-10-14 21:24:50 -04:00
dickmao
0c6e37c8e0 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-13 13:09:53 -04:00
John Miller
af405dddb7 ein-notebooklist: Document ein:populate-hierarchy-on-notebooklist-open. 2018-10-12 20:51:32 -05:00
John Miller
c51134fa65 ein-notebooklist: Make hierarchy query optional.
Via the `ein:populate-hierarchy-on-notebooklist-open' variable, which we need to
document stat.
2018-10-12 15:32:51 -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
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
Sam Steingold
f2396e6ebe simplify code 2018-09-05 09:50:12 -04:00
Sam Steingold
0cc585f7f2 remove a spurious "}" in help 2018-09-05 09:50:12 -04:00
Sam Steingold
bdcfa149ab untabify and fix indentation 2018-09-05 09:50:12 -04:00
John Miller
c648424389 Fix #297.
Raise an error if the user does not specify the port or the full URL when
calling functions like `ein:notebooklist-open' and `ein:notebooklist-login'.

It can be debated that ein should assume http over https if the user doesn't
specify, but I currently think it shouldn't. Debate me.
2018-08-29 17:32:09 -05:00
John Miller
895777f5ea Try again to fix eager macro expansion error on travis. 2018-05-31 13:15:04 -05:00
John Miller
59d2b83a21 Maybe fix eager macro expansion error on travis. 2018-05-31 07:56:38 -05:00
Sam Steingold
58a199e1c6 code cleanup: remove ein:min and ein:do-nothing (ELisp has min and ignore) 2018-05-27 12:04:13 -04:00
Sam Steingold
264f355081 make timestamp format customizable and default to ISO 8601
add ein:format-time-string and use it for both ein:timestamp-format
and ein:notebooklist-date-format
2018-05-25 11:43:39 -04:00
John Miller
6e9fa64bb0 Fix #260.
See new interactive function `ein:notebooklist-refresh-kernelspecs'. Maybe I
will document it by the next commit.
2018-05-20 08:42:42 -05:00
Sam Steingold
b0bc1b2293 make default notebooklist sorting customizable
(ein:notebooklist-sort-field): New custom var, replaces `ein:%item-sort-param%'.
(ein:notebooklist-sort-order): New custom var, replaces `ein:%item-sort-order%'.
(ein:make-sorting-widget): New macro.
(ein:nblist--sort-group): Fix the meaning of :ascending & :descending.
(render-directory): Use `ein:make-sorting-widget' to define widgets;
use the new custom vars instead of the internal %% vars.
2018-05-04 15:07:32 -04:00
Sam Steingold
5bf4afb33b Make date format in notebooklist mode customizable.
(ein:notebooklist-date-format): New user variable.
(ein:format-nbitem-data): Use it.
2018-04-23 17:33:13 -04:00
John Miller
be5792da8d ein-notebooklist: More featureful sorting of directory listing.
Not much of a UI at the moment, but notebooklist entries can now be sorted
either by name or by date last modified. Jupyter does not provide size
of each item, that I can see (for the moment), so currently not possible to sort
by that parameter.
2018-04-22 20:57:01 -05:00
John Miller
d1c3464583 Formatting cleanup, sort notebooklist entries by name.
Taking some initial steps to implement features requested in #293 by @sam-s.
2018-04-22 10:22:11 -05:00
Patrick
ccd43f857b This version works 2018-03-31 14:38:25 -07:00
Patrick
6eb1c100a3 Revert "Starting to split render functions for ipy2"
This reverts commit bd3f41d683.
2018-03-31 13:58:01 -07:00
Patrick
42ff34d82a This assumes ipy-version is globally accessible 2018-03-31 13:06:26 -07:00
Patrick
2099e7cd1c Not sure where ipyversion is accessable 2018-03-31 13:03:40 -07:00
Patrick
b775732e4e Add notes so I can combine the two render-directory funcs 2018-03-31 12:58:32 -07:00
Patrick
bd3f41d683 Starting to split render functions for ipy2
There's still a lot of repeated code that could be shared b/w the ipy2
and ipy3 functions.  Need to make sure I understand it first.
2018-03-27 22:34:19 -07:00
Patrick
3466d0f87d Cleanup - undo unrelated changes
I had made a few other changes to satisfy my linter.  This removes
those changes so it's more clear what I was editing to change the
rendering order.
2018-03-25 13:42:35 -07:00
Patrick
e2734c9749 You can now customize order with ein:notebook-list-render-order 2018-03-25 13:30:50 -07:00
Patrick
adc85796e4 Works, puts open notebooks above directory 2018-03-25 12:32:31 -07:00
John Miller
a8fc712ca8 ob-ein: Wrap if-let* var list properly.
Make async work a little better, but can still have problems if one tries to
execute several source blocks at once.
2018-03-10 07:07:37 -06:00