Skip to content

add contents webservice#5938

Merged
minrk merged 16 commits into
ipython:masterfrom
minrk:contents2
Jul 31, 2014
Merged

add contents webservice#5938
minrk merged 16 commits into
ipython:masterfrom
minrk:contents2

Conversation

@minrk
Copy link
Copy Markdown
Member

@minrk minrk commented Jun 3, 2014

This mainly renames the 'notebooks' service to 'contents' and teaches it about regular files. There is no longer special treatment of directories, just different forms for content. Tree view now shows all files.

As usual, modeled on GitHub contents API.

I will enumerate the changes to the models and API, but the gist:

  • all contents models have name, path, dates, type
  • type is one of: directory, file, notebook
  • if content is requested:
    • additional format key will be json, text, or base64, describing content
    • content will be
      • list of JSON models for directory contents
      • notebook JSON for notebooks (format=json)
      • file text for text files (format=text)
      • b64-encoded data for binary files (format=base64)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...if the file exists, else returns False....

@andreabedini
Copy link
Copy Markdown

Is there a roadmap/IPEP for the contents web-service? I'm working to port bookstore notebook manager to IPython 2 and I feel like I'm late to the party.

@minrk
Copy link
Copy Markdown
Member Author

minrk commented Jun 16, 2014

I'm still working on the IPEP, I'll link to it when I put it up.

@minrk
Copy link
Copy Markdown
Member Author

minrk commented Jun 16, 2014

I've posted the current state of the IPEP

@andreabedini
Copy link
Copy Markdown

Thanks @minrk

@minrk
Copy link
Copy Markdown
Member Author

minrk commented Jun 17, 2014

The /files/ handler should be handled by the ContentsManager, but I don't want to deal with that in this PR.

juhasch pushed a commit to ipython-contrib/jupyter_contrib_nbextensions that referenced this pull request Jun 17, 2014
As of ipython/ipython#5938:
Use contents webservice instead of own websocket server.
juhasch pushed a commit to juhasch/jupyter_contrib_nbextensions that referenced this pull request Jun 18, 2014
Remove own websocket service and use new IPython contents webservice:
ipython/ipython#5938
@minrk
Copy link
Copy Markdown
Member Author

minrk commented Jun 30, 2014

Rebased, and review should be addressed. I don't have anything else planned to do here.

@minrk minrk added this to the 3.0 milestone Jun 30, 2014
@ellisonbg
Copy link
Copy Markdown
Member

I do have other review that I am doing on this one - will try to get
comments to you soon, but not today - writing a letter for our BFDL...

On Mon, Jun 30, 2014 at 10:54 AM, Min RK notifications@github.com wrote:

Rebased, and review should be addressed. I don't have anything else
planned to do here.


Reply to this email directly or view it on GitHub
#5938 (comment).

Brian E. Granger
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com

@ellisonbg
Copy link
Copy Markdown
Member

That is BDFL...

On Mon, Jun 30, 2014 at 10:56 AM, Brian Granger ellisonbg@gmail.com wrote:

I do have other review that I am doing on this one - will try to get
comments to you soon, but not today - writing a letter for our BFDL...

On Mon, Jun 30, 2014 at 10:54 AM, Min RK notifications@github.com wrote:

Rebased, and review should be addressed. I don't have anything else
planned to do here.


Reply to this email directly or view it on GitHub
#5938 (comment).

Brian E. Granger
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com

Brian E. Granger
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com

@fperez
Copy link
Copy Markdown
Member

fperez commented Jun 30, 2014

Happy to hop in, I can ask @minrk to fill me in the details to save you time, @ellisonbg.

@fperez
Copy link
Copy Markdown
Member

fperez commented Jun 30, 2014

Sorry, misunderstood the ping... Yes, please stick to that letter ;)

@minrk
Copy link
Copy Markdown
Member Author

minrk commented Jul 12, 2014

Rebased on require.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Serving contents"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the contents manager have methods/parameters for things like "does this exist and is it a notebook", or "load this, throwing an error if it is not a notebook"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary. The caller can always check the type field in the model if it's desired.

minrk added 16 commits July 31, 2014 11:57
minimal functional changes, committing because tests are passing.
- missed some s/notebook/file/ in docstrings
- manager doesn’t sort contents
can’t copy directories
avoids 404 on /files for visiting a nonexistent notebook
a few more notebook mentions in docstrings,
and inappropriate use of setdefault.
and reuse it in /nbconvert/html/…

closes ipython#6137
- clarified docstrings and errors
- still more notebook/file renames
- configurable untitled names
- copy_from can be full path
- fix running, upload, new-tab behaviors in dashboard

Yay, review!
- recognize 201 as success (dataType must not be 'json')
- support uploading non-notebook files (b64-encoded)
- fix is_hidden always returning True on nonexistent files
- create hidden dir fails with 400
- don't read binary files twice
- logging improvements
- dialog on invalid notebook upload
- warn about disabled `--save`
minrk added a commit that referenced this pull request Jul 31, 2014
@minrk minrk merged commit 6ecbe72 into ipython:master Jul 31, 2014
@minrk minrk deleted the contents2 branch July 31, 2014 19:24
@minrk
Copy link
Copy Markdown
Member Author

minrk commented Jul 31, 2014

Merged, yay!

@ellisonbg
Copy link
Copy Markdown
Member

Great work!

On Thu, Jul 31, 2014 at 12:25 PM, Min RK notifications@github.com wrote:

Merged, yay!


Reply to this email directly or view it on GitHub
#5938 (comment).

Brian E. Granger
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants