##// END OF EJS Templates
adding stream kwarg to current.new_output...
Paul Ivanov -
Show More
@@ -53,7 +53,7 b' def from_dict(d):'
53 def new_output(output_type=None, output_text=None, output_png=None,
53 def new_output(output_type=None, output_text=None, output_png=None,
54 output_html=None, output_svg=None, output_latex=None, output_json=None,
54 output_html=None, output_svg=None, output_latex=None, output_json=None,
55 output_javascript=None, output_jpeg=None, prompt_number=None,
55 output_javascript=None, output_jpeg=None, prompt_number=None,
56 etype=None, evalue=None, traceback=None):
56 etype=None, evalue=None, traceback=None, stream=None):
57 """Create a new code cell with input and output"""
57 """Create a new code cell with input and output"""
58 output = NotebookNode()
58 output = NotebookNode()
59 if output_type is not None:
59 if output_type is not None:
@@ -89,6 +89,9 b' def new_output(output_type=None, output_text=None, output_png=None,'
89 if traceback is not None:
89 if traceback is not None:
90 output.traceback = [unicode(frame) for frame in list(traceback)]
90 output.traceback = [unicode(frame) for frame in list(traceback)]
91
91
92 if output_type == u'stream':
93 output.stream = 'stdout' if stream is None else unicode(stream)
94
92 return output
95 return output
93
96
94
97
@@ -93,6 +93,7 b' ws.cells.append(new_code_cell('
93 output_text='foo\rbar\r\n'
93 output_text='foo\rbar\r\n'
94 ),new_output(
94 ),new_output(
95 output_type=u'stream',
95 output_type=u'stream',
96 stream='stderr',
96 output_text='\rfoo\rbar\n'
97 output_text='\rfoo\rbar\n'
97 )]
98 )]
98 ))
99 ))
General Comments 0
You need to be logged in to leave comments. Login now