mirror of
https://github.com/wassname/jupyter_contrib_nbextensions.git
synced 2026-08-20 12:30:31 +08:00
Add no execute dunder as asked by greg
This commit is contained in:
@@ -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 ____')
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user