##// END OF EJS Templates
support contiguous stream output in notebook...
MinRK -
Show More
@@ -251,6 +251,23 b' var IPython = (function (IPython) {'
251 251
252 252
253 253 CodeCell.prototype.append_stream = function (json) {
254 // temporary fix: if stream undefined (json file written prior to this patch),
255 // default to most likely stdout:
256 if (json.stream == undefined){
257 json.stream = 'stdout';
258 }
259 if (this.outputs.length > 0){
260 // have at least one output to consider
261 var last = this.outputs[this.outputs.length-1];
262 if (last.output_type == 'stream' && json.stream == last.stream){
263 // latest output was in the same stream,
264 // so append directly into its pre tag
265 this.element.find('div.output_stream').last().find('pre').append(json.text);
266 return;
267 }
268 }
269
270 // If we got here, attach a new div
254 271 var toinsert = this.create_output_area();
255 272 this.append_text(json.text, toinsert);
256 273 this.element.find('div.output').append(toinsert);
@@ -710,7 +710,8 b' var IPython = (function (IPython) {'
710 710 var json = {};
711 711 json.output_type = msg_type;
712 712 if (msg_type === "stream") {
713 json.text = utils.fixConsole(content.data + '\n');
713 json.text = utils.fixConsole(content.data);
714 json.stream = content.name;
714 715 } else if (msg_type === "display_data") {
715 716 json = this.convert_mime_types(json, content.data);
716 717 } else if (msg_type === "pyout") {
General Comments 0
You need to be logged in to leave comments. Login now