diff --git a/no_exec_dunder.js b/no_exec_dunder.js new file mode 100644 index 0000000..1cd6240 --- /dev/null +++ b/no_exec_dunder.js @@ -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 ____') + } + }; + +});