##// END OF EJS Templates
Merge pull request #6692 from blink1073/qtconsole-completion...
Merge pull request #6692 from blink1073/qtconsole-completion Improve handling of cursor_start and cursor_end for QtConsole completions.

File last commit:

r17883:30e10449
r18365:3f95fb30 merge
Show More
clearoutput.py
28 lines | 963 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.
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from .base import Preprocessor
#-----------------------------------------------------------------------------
# Classes
#-----------------------------------------------------------------------------
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.prompt_number = None
return cell, resources