Commit graph

37 commits

Author SHA1 Message Date
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
John Miller
dd494cba59 Less talkative notebook saving.
EIN now logs messages regarding notebook saving using 'verbose level.
2016-10-23 19:26:21 -05:00
John Miller
bb95f71f5e Give ein notebooks content checkpoint functionality. 2016-10-19 14:43:19 -05:00
John Miller
7d8474e2c4 Low level support for managing notebook checkpoints.
Via the Jupyter contents REST API.
2016-10-19 11:57:34 -05:00
John Miller
256b14a49f Make synchronous comm a user configurable parameter.
EIN can communicate with the jupyter contents API synchronously or
asyncronously, with the default behavior the latter. For a time it has
been possible to force synchronous from the code, but now I have made
that a user-configurable parameter (see `ein:force-sync`).
2016-10-05 11:39: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
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
a73e6f0be4 Remove :sync t from content save call.
That was uncomfortable.
2016-01-11 15:13:01 -07:00
John Miller
1987f601c7 Fix event firing for content save errors.
Code wasn't calling `ein:notebook-save-notebook-error` when content
saving failed. Small detail, but would result in "Notebook saving"
eternally hanging out in notebook message display.
2016-01-11 15:11:14 -07:00
John Miller
a1489613ac Fixing null in output metadata
Somewhat hackish solution by defadvicing json.el code to
overcome possible bug in said code. Apparently
`json-encode` does not handle nested empty hash tables properly.
2016-01-03 08:23:55 -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
aaee6d0348 Properly encode notebook paths
This should fix an obscure (well, at least no one has created an issue
for this yet) failure trying to open a notebook path that contains
characters like (, or ), etc. that need to be escaped in the REST API
call.
2015-06-17 12:09:48 -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
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
c1ce100f31 Renaming notebooks works again in IPython 2.x
As an added bonus you should be able to move notebooks to different
directories in the notebook hierarchy. Not tested, though, so I'm not
sure how well that works.
2015-02-16 21:14:47 -06:00
John Miller
ff415f3ebc Unbreaking ein:notebook-rename-command 2015-02-16 13:06:35 -06:00
John Miller
f711a83d42 Fixing up some typos. 2015-02-15 11:34:50 -06:00
John Miller
f8a82b8e24 Correctly determine path for 2.x notebooks
Found another corner cases for IPython 2.x.
2015-02-12 12:10:56 -06:00
John Miller
098dddd3e9 Regain IPython 2.x compatibility I
Notebooks now save in IPython 2.x and 3.x.
2015-02-12 08:45:29 -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
66db53333b Generic query contents for IPython 2.x and beyond
Renamed `ein:content-list-contents` to reflect it's more generic
function.

Added support fro content querying of IPython 2.x notebook servers.
2015-02-09 13:27:20 -06:00
John Miller
0796ed2dce Fix typos
Never can remember the names of the keywords for request.
2015-01-31 10:32:52 -06:00
John Miller
c30bad19a5 Content renaming
Call ein:content-rename to rename a content object in ein and at the
Jupyter server.
2015-01-31 10:31:20 -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