##// END OF EJS Templates
handle undefined or closed zmq_stream in on_message...
handle undefined or closed zmq_stream in on_message can happen if a message is waiting in a pipe and the web socket is closed before the message is handled. And give ZMQChannels a nice repr with their kernel ID

File last commit:

r16296:a9860b18
r17647:5e9f12e7
Show More
clearoutput.py
27 lines | 925 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 = []
return cell, resources