Add no execute dunder as asked by greg

This commit is contained in:
Matthias BUSSONNIER
2013-07-30 08:02:51 +02:00
parent 3c29264cf5
commit fb439d5f10
+17
View File
@@ -0,0 +1,17 @@
define(["require"], function(require) {
console.log('patching codecell');
console.log('old is',IPython.CodeCell.prototype.execute)
IPython.CodeCell.prototype.old_execute = IPython.CodeCell.prototype.execute
IPython.CodeCell.prototype.execute = function () {
console.log(this.get_text().match('_{4,}'))
if ( ! this.get_text().match('_{4,}') ){
console.log('oe');
this.old_execute(arguments); // not sure of the unpacking of arguments here, might be [arguments]
} else {
this.output_area.element.text('not quite there yet you still have to many ____')
}
};
});