-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
save() should download files in the notebook #17942
Comments
comment:1
The
|
Replying to @vbraun:
I'm not sure that I agree with this. You might want to If you want download functionality, I would prefer to use a new |
comment:3
Just to clarify, save() should of course still save the file on the remote file system. It just should in addition get the file to the client. Tying it to the displayhook already gives you a means to control whether or not the file is downloaded. Also, if you really just save a temporary file on the server you are more likely to do that form within code so it wouldn't be downloaded anyway. There could be other switches, maybe |
comment:4
With cloud applications (let's consider sagenb as such an application), "save" usually means "save on the remote system". The notebook interface has "Save" and "Save & quit" buttons, neither of these result in a downloaded file. |
comment:5
From a user these are two different activities:
|
Commit: |
This comment has been minimized.
This comment has been minimized.
comment:7
Apparently not so easy in IPython (ipython/ipython#8053), I implemented a moderately hackish workaround. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Author: Volker Braun |
comment:9
SageNB often replaces the cell dom with the saved part even for cells that you don't currently work on. So javascript inside the cell can't really initiate the download or it would do it again all the time. So its just a download link in SageNB. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
This works now in both notebooks, imho it is the cleanest way of expressing what you want to do:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:17
does not apply, needs rebase |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:20
Fixed |
comment:21
does not apply |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:24
This looks pretty robust. Should we expect any other Also, this doesn't appear to require any changes in sagenb; I ask because I'm looking at that right now, but I don't see anything that does. |
comment:25
Replying to @kcrisman:
I don't really have an opinion either way; We could.
No changes to SageNB required. |
comment:26
Great, I didn't think so. I guess as long as this does what we intend for now (does it make a link for non-graphics files too? just curious) then this would be a good addition. |
comment:27
It always makes a link regardless of the file type |
comment:28
does not apply |
In a browser-based notebook an object's
save()
method should automatically download the saved file and not just let it linger on the remote server.I'm proposing to do this by returning, from
save()
, aSavedFile
object instead of nothing. TheSavedFile._rich_repr_
method then returns a custom rich representation which gives browser-based display backends a hook to do something with the saved file. Also, nothing happens if you call save() from within code---only if it hits the displayhook:CC: @gagern @kcrisman
Component: user interface
Author: Volker Braun
Branch/Commit: u/vbraun/save_should_download_files @
b3a066a
Issue created by migration from https://trac.sagemath.org/ticket/17942
The text was updated successfully, but these errors were encountered: