From fb439d5f10cbb192ff680bfdded32ab95a399294 Mon Sep 17 00:00:00 2001 From: Matthias BUSSONNIER Date: Tue, 30 Jul 2013 08:02:51 +0200 Subject: [PATCH] Add no execute dunder as asked by greg --- no_exec_dunder.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 no_exec_dunder.js 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 ____') + } + }; + +});