Ticket #336 (closed enhancement: fixed)
[with patch; positive review] Create an option to clear all cell output
| Reported by: | TimothyClemans | Owned by: | boothby |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-3.0.2 |
| Component: | notebook | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | Reviewers: | ||
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
I am homeschooled and doing programming in the notebook for credit. I would like to clear all of the output on my worksheets so I can print the code for the worksheet without the computer generated output.
Attachments
Change History
comment:2 Changed 4 years ago by was
- Summary changed from Create an option to clear all cell output to [with patch; needs review] Create an option to clear all cell output
The attached patch does the following:
Fix trac #336 -- "delete all output" for the Sage notebook worksheets. Also:
1. Changed "Revisions" to "Undo" in the notebook, since it is clearer.
2. Added several new functions needed to implement #336 and fully documented
and doctested all of them. This meant improving the functions that
support writing doctests for the notebook, and doctesting those
functions too. Doctesting of the notebook is thus actually *greatly*
improved by this patch.
3. Made some fixes to doctests also so that parallel doctesting works.
In particular, avoid clashes in temp notebook names.
4. Created a cell "evaluated" function to keep track of whether or not
cells have been evaluated. I did this in order to non-hackishly
implement "delete all output". It will also be very useful for other
tickets. I added a lot of doctesting related to this too.
5. Added a worksheet function user_can_edit to double check that the
given user can edit the worksheet; this is used by the "delete all output"
code as a double check that invalid users can't delete all output.
To test it do the following:
- apply the patch and build
- Make a worksheet and selected "Action -> Delete all output"
- Note that all output is gone. Click refresh to see that the server got the message
- Doctest the sage/server/notebook directory. It has a bunch of new doctests.
- Read over the patch itself to see how it's all implemented:
- some javascript to delete the output from the DOM
- some server-side python code to do the actual deleting
- some general server-side code to improving doctesting of the notebook.
- general doc improvements.
comment:3 Changed 4 years ago by TimothyClemans
- Summary changed from [with patch; needs review] Create an option to clear all cell output to [with patch; negative review] Create an option to clear all cell output
One doctest failure
File "/home/tclemans/sage-3.0/tmp/notebook.py", line 133:
sage: os.listdir('notebook-test')
Expected:
['backups', 'nb.sobj', 'objects', 'worksheets']
Got:
['worksheets', 'objects', 'backups', 'nb.sobj']
comment:4 Changed 4 years ago by TimothyClemans
- Summary changed from [with patch; negative review] Create an option to clear all cell output to [with patch; positive review] Create an option to clear all cell output
Positive review with doctestfix patch. I didn't really do 5 except I did look at the doctest stuff.
Note: See
TracTickets for help on using
tickets.

