Commit graph

110 commits

Author SHA1 Message Date
John Miller
aebdbc1eb8 ein-cell: Fix saving images in worksheets.
Images weren't being save to json in the way they should have. Mostly had to do
with how the attirbutes were being ordered. This is still, unfortunately, a
nasty bit code but it still seems to work.
2017-06-30 21:41:16 -05:00
John Miller
c1d263fa13 ein:notebooklist: A faster, better change url.
Make the process of changing URL's via `ein:notebooklist-change-url-port'
smoother and more user-friendly.
2017-06-03 15:45:28 -05:00
John Miller
22cc948975 ein:notebooklist-change-url-port: Better deferred syntax, use lexical bindings. 2017-05-30 14:33:31 -05:00
John Miller
e3eca1115d ein-notebooklist: Avoid auth issues when changing host url.
When calling `ein:notebooklist-change-url-port' first make call to
notebooklist-open to ensure cookies are properly created/refreshed before trying
to save notebook and restart kernels.

Note this uses a bit of magic from deferred, which was already being used in
ein-jedi.el, but somehow never made it into the list of required pacakges. We
are now correcting that oversite.

Extend the timeout when querying the ipython/jupyter version. Also try to detect
when timeouts occur and in such cases temporarily assume a version (4 for the
moment).
2017-05-30 14:05:02 -05:00
John Miller
4a487ab9b8 ein-notebooklist: New function ein:notebooklist-change-url-port
Like `ein:notebook-update-url-or-port', but for all the notebooks opened from the
current notebooklist buffer.

Fix bug in `ein:notebook-update-url-or-port' that was keeping the kernel from
restarting.
2017-05-24 09:53:58 -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
58d8142d0a Numerous documentation updates.
Get rid of ein-sections: you are not yet ready for the world young man!
2017-02-16 09:01:14 -06:00
John Miller
4ccaa9337c Allow keepalive to be automatically enabled.
When the customizable variable `ein:enable-keepalive` is non-nil EIN will
automatically call `ein:notebooklist-enable-keepalive` when calling
`ein:notebooklist-open`. Keepalive has also been tweaked to make sure it does
not create multiple timers.
2017-02-15 19:33:35 -06:00
John Miller
a4f9128182 Steps towards sections. More stable notebooklist buffers.
Initial steps integrating magit's sections into ein. Also an attempt to make
notebooklist buffers more "stable" by adding a slight pause during session
queries.
2017-02-12 22:09:44 -06:00
John Miller
8ec5d4638e Prototyping the object inspector buffer.
Display value of object's __repr__, link to source when available, and
documentation.

Adding command and keybinding (C-ci) to notebook buffer keymap.

Get rid of unnecessary api check when rendering notebooklist buffer.
2017-02-06 20:19:20 -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
94e334cbf0 Try to keep long running sessions from expiring
The function `ein:notebooklist-enable-keepalive` and
`ein:notebooklist-disable-keepalive`, respectively enable a timer that
ocassionally (on the order of hours) sends a query to the notebook server. The
goal is to keep cookies and sessions from expiring in long running notebooks.
We'll see if it works.
2017-01-31 10:44:04 -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
Sam Steingold
5d06c91349 autoload ein:notebooklist-login (issue#154) 2016-12-27 12:04:25 -05:00
John Miller
9468f40bce Better kernelspec display name, pytools only for python kernels.
Prettier kernelspec names in notebooklist buffers. Only load pytools for python
kernels, which hopefully will help with connecting to non-python kernels.
2016-12-22 14:04:51 -06:00
John Miller
495d652ee0 Cosmetic updates to code formatting. 2016-12-18 19:27:35 -06:00
Josiah Schwab
23c8148cb7 Update notebooklist url functions to work with jupyter
Previously, base-path would be nil when version was 4 (corresponding
to the current jupyter release).
2016-11-11 09:48:47 -08: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
71d8994ebb Undoing earlier bone-headedness
Finally getting Sam's PR right (sorry about that, Sam). Getting the
mocker subtree into the right place because apparently I cannot type.
2016-09-23 10:37:48 -05:00
John Miller
706ff2184a Merge branch 'pr/117' 2016-09-19 10:46:43 -05:00
John Miller
ed70a26700 Set local keymap for ein's derived modes. 2016-09-19 09:02:35 -05:00
John Miller
ef949a189d Revert "derived modes inherit from special-mode or view-mode as appropriate"
This reverts commit 99de3360c3.
2016-09-15 14:14:42 -05:00
Sam Steingold
99de3360c3 derived modes inherit from special-mode or view-mode as appropriate
this means that the derived modes get all the standard keybinding in the standard way.
2016-09-13 09:32:31 -04:00
John Miller
40b34cd8b5 Close opened buffer from notebooklist buffer.
Do a better job with lexical-let's, add close command to opened notebook
list.
2016-09-04 17:58:55 -05:00
John Miller
afc6ca6102 More informative notebooklist buffer
It may be info overload, but notebooklist buffers will now list all
opened notebooks.
2016-08-31 10:04:06 -05:00
Guillaume Anciaux
62c0c21d28
cleaning some debug messages 2016-07-19 10:46:50 +02:00
Guillaume Anciaux
1c549e72d7
addîng the slide info in prompt and allow switch slide type with C-c C-d 2016-07-19 10:37:00 +02: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
bd9668702a Fix for issue #92
Use lexical-let vs let in `ein:notebooklist-render.`
2016-03-23 12:31:47 -05:00
John Miller
7e4df981c8 Fix for issue #91
Corrected `ein:junk-new` to include kernelspec selection.
2016-03-22 07:47:11 -05:00
John Miller
c5cf44a795 Fix saving new notebooks, whitespace updates.
Newly created notebooks no longer error on saving - bug in how
kernelspec metadata was being filled in.

Also a number of miscellaneous fixes to indentation that have
inexplicably appeared in the code.

Some small fixes for typos and catching up on version info.
2016-03-01 16:02:00 -06:00
John Miller
24afb15985 Bump to v0.8.0 2016-02-02 12:12:46 -06:00
John Miller
5dec56eec2 Respect kernelspec info in notebook metadata.
This should allow us to reload notebooks using the same
kernel they were running when saved.
2016-01-13 18:07:15 -06: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
25d1437de6 Ask for kernel when creating named notebook.
We don't do anything with the info, yet, but it is a good
test for our code for getting available kernels from the Jupyter
server.
2016-01-11 20:21:19 -07:00
John Miller
b8aa391b31 Fix ein:make-content-hierarchy.
In the end so ein:notebooklist-open-notebook-global can work.
2015-12-04 14:15:41 -06:00
John Miller
3aa290ed91 Fix breadcrumbs in notebook list.
Seems like a regression, but I'm not 100% sure on that.

Update metadata name (add ein qualifier) per Jupyter documentation
guidance.
2015-09-14 13:16:49 -05: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
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
2eeae04a03 Fix issue #35
Get ein:junk-new working again under IPython 2.x.

Some non-related work on fixing `ein:pytools-export-buffer`. Not quite
there yet, but I have an idea of what is going on.
2015-03-25 09:52:16 -05:00
John Miller
bc3e2ffdc6 Cleaning up calls to ein:notebooklist-open
Syncronizing API update for opening notebooks across various calls in
ein-notebooklist.
2015-02-12 09:20:34 -06:00
John Miller
8836cf6152 Bug in notebooklist-render
Now correctly detects when a notebook is open and kernel running.
2015-02-10 14:56:41 -06:00
John Miller
f71676ac88 Refactoring notebook management
Work in progress.

Lots and lots of changes trying to clean up code so there are not so
many checks of IPython version. Also a significant amount of refactoring
all notebook server requests code to ein-contents-api.

Also moving away from notebook-id concept; instead use notebook path to
uniquely identify notebooks/content.

Made `ein:query-ipython-version` more efficient by caching results.
2015-02-10 14:53:08 -06:00
John Miller
55be1cbf26 Refactoring support for contents API
Start of a refactor of code for accessing Jupyter's new contents API.
First up an implementation of list contents.

New function for flattening lists borrowed from cl-alexandria (how did
we survive withoutthis in the before times?)

Updating author list here and there.
2015-01-31 10:13:49 -06:00
millejoh
c0a3a7d1e0 Be more specific when creating a new notebook.
When creating a new notebook pass some additional json so IPython
knows we want to create a notebook, and not a file or directory (this
was causing problems with IPython-dev).
2015-01-16 22:01:54 -06:00
John Miller
c1ba0efc11 Notebooklist auto-reload hack
Auto-reload notebooklist after opening a notebook or stopping a kernel.
Feels hacky using run-at-time, especially with a constant time (3
seconds).
2015-01-13 06:40:15 -06:00
John Miller
26f1696c6b Revert "Autoupdate notebooklist buffer on open or stop"
This reverts commit 90c26ad16d.
2015-01-09 10:27:45 -06:00