Show More
@@ -1,32 +1,27 b'' | |||||
1 | """Module containing a preprocessor that removes the outputs from code cells""" |
|
1 | """Module containing a preprocessor that removes the outputs from code cells""" | |
2 |
|
2 | |||
3 | #----------------------------------------------------------------------------- |
|
3 | # Copyright (c) IPython Development Team. | |
4 | # Copyright (c) 2013, the IPython Development Team. |
|
|||
5 | # |
|
|||
6 | # Distributed under the terms of the Modified BSD License. |
|
4 | # Distributed under the terms of the Modified BSD License. | |
7 | # |
|
|||
8 | # The full license is in the file COPYING.txt, distributed with this software. |
|
|||
9 | #----------------------------------------------------------------------------- |
|
|||
10 |
|
5 | |||
11 | #----------------------------------------------------------------------------- |
|
6 | #----------------------------------------------------------------------------- | |
12 | # Imports |
|
7 | # Imports | |
13 | #----------------------------------------------------------------------------- |
|
8 | #----------------------------------------------------------------------------- | |
14 |
|
9 | |||
15 | from .base import Preprocessor |
|
10 | from .base import Preprocessor | |
16 |
|
11 | |||
17 |
|
12 | |||
18 | #----------------------------------------------------------------------------- |
|
13 | #----------------------------------------------------------------------------- | |
19 | # Classes |
|
14 | # Classes | |
20 | #----------------------------------------------------------------------------- |
|
15 | #----------------------------------------------------------------------------- | |
21 | class ClearOutputPreprocessor(Preprocessor): |
|
16 | class ClearOutputPreprocessor(Preprocessor): | |
22 | """ |
|
17 | """ | |
23 | Removes the output from all code cells in a notebook. |
|
18 | Removes the output from all code cells in a notebook. | |
24 | """ |
|
19 | """ | |
25 |
|
20 | |||
26 | def preprocess_cell(self, cell, resources, cell_index): |
|
21 | def preprocess_cell(self, cell, resources, cell_index): | |
27 | """ |
|
22 | """ | |
28 | Apply a transformation on each cell. See base.py for details. |
|
23 | Apply a transformation on each cell. See base.py for details. | |
29 | """ |
|
24 | """ | |
30 | if cell.cell_type == 'code': |
|
25 | if cell.cell_type == 'code': | |
31 | cell.outputs = [] |
|
26 | cell.outputs = [] | |
32 | return cell, resources |
|
27 | return cell, resources |
General Comments 0
You need to be logged in to leave comments.
Login now