##// END OF EJS Templates
Backing out all changes to the UI and notebook.js....
Backing out all changes to the UI and notebook.js. Updated kernel.js to trigger the ``received_unsolicited_message.Kernel`` event instead. Notebook extensions can handle the event in whatever way they deem appropriate. A notebook extension that takes advantage of this is available at https://github.com/nheijermans/nbexts.git.

File last commit:

r18587:1e136a8b
r19515:3afcf59b
Show More
clearoutput.py
20 lines | 627 B | text/x-python | PythonLexer
"""Module containing a preprocessor that removes the outputs from code cells"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from .base import Preprocessor
class ClearOutputPreprocessor(Preprocessor):
"""
Removes the output from all code cells in a notebook.
"""
def preprocess_cell(self, cell, resources, cell_index):
"""
Apply a transformation on each cell. See base.py for details.
"""
if cell.cell_type == 'code':
cell.outputs = []
cell.execution_count = None
return cell, resources