Show More
@@ -1,28 +1,28 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 | # Copyright (c) IPython Development Team. |
|
3 | # Copyright (c) IPython Development Team. | |
4 | # Distributed under the terms of the Modified BSD License. |
|
4 | # Distributed under the terms of the Modified BSD License. | |
5 |
|
5 | |||
6 | #----------------------------------------------------------------------------- |
|
6 | #----------------------------------------------------------------------------- | |
7 | # Imports |
|
7 | # Imports | |
8 | #----------------------------------------------------------------------------- |
|
8 | #----------------------------------------------------------------------------- | |
9 |
|
9 | |||
10 | from .base import Preprocessor |
|
10 | from .base import Preprocessor | |
11 |
|
11 | |||
12 |
|
12 | |||
13 | #----------------------------------------------------------------------------- |
|
13 | #----------------------------------------------------------------------------- | |
14 | # Classes |
|
14 | # Classes | |
15 | #----------------------------------------------------------------------------- |
|
15 | #----------------------------------------------------------------------------- | |
16 | class ClearOutputPreprocessor(Preprocessor): |
|
16 | class ClearOutputPreprocessor(Preprocessor): | |
17 | """ |
|
17 | """ | |
18 | Removes the output from all code cells in a notebook. |
|
18 | Removes the output from all code cells in a notebook. | |
19 | """ |
|
19 | """ | |
20 |
|
20 | |||
21 | def preprocess_cell(self, cell, resources, cell_index): |
|
21 | def preprocess_cell(self, cell, resources, cell_index): | |
22 | """ |
|
22 | """ | |
23 | Apply a transformation on each cell. See base.py for details. |
|
23 | Apply a transformation on each cell. See base.py for details. | |
24 | """ |
|
24 | """ | |
25 | if cell.cell_type == 'code': |
|
25 | if cell.cell_type == 'code': | |
26 | cell.outputs = [] |
|
26 | cell.outputs = [] | |
27 |
cell |
|
27 | cell.prompt_number = None | |
28 | return cell, resources |
|
28 | return cell, resources |
General Comments 0
You need to be logged in to leave comments.
Login now