##// END OF EJS Templates
Make comm manager (mostly) independent of InteractiveShell...
Make comm manager (mostly) independent of InteractiveShell This makes it possible to use comms from wrapper kernels, without instantiating the full IPython shell machinery. The one remaining place where we need a reference to shell is to fire pre_execute and post_execute hooks (which are needed to get mpl figures right). This is a pure IPythonism, that it should be safe to ignore if shell is not set.

File last commit:

r15873:8be8acce
r17964:a59dfd02
Show More
keyboard.js
49 lines | 1.6 KiB | application/javascript | JavascriptLexer
Brian E. Granger
Adding basic tests for keyboard.js
r15617
var normalized_shortcuts = [
Paul Ivanov
use - for shortcut separators
r15873 'ctrl-shift-m',
'alt-meta-p',
Brian E. Granger
Adding basic tests for keyboard.js
r15617 ];
var to_normalize = [
Paul Ivanov
use - for shortcut separators
r15873 ['shift-%', 'shift-5'],
['ShiFT-MeTa-CtRl-AlT-m', 'alt-ctrl-meta-shift-m'],
Brian E. Granger
Adding basic tests for keyboard.js
r15617 ];
var unshifted = "` 1 2 3 4 5 6 7 8 9 0 - = q w e r t y u i o p [ ] \\ a s d f g h j k l ; ' z x c v b n m , . /";
// shifted = '~ ! @ # $ % ^ & * ( ) _ + Q W E R T Y U I O P { } | A S D F G H J K L : " Z X C V B N M < > ?';
casper.notebook_test(function () {
this.then(function () {
this.each(unshifted.split(' '), function (self, item) {
var result = this.evaluate(function (sc) {
var e = IPython.keyboard.shortcut_to_event(sc);
var sc2 = IPython.keyboard.event_to_shortcut(e);
return sc2;
}, item);
this.test.assertEquals(result, item, 'Shortcut to event roundtrip: '+item);
});
});
this.then(function () {
this.each(to_normalize, function (self, item) {
var result = this.evaluate(function (pair) {
return IPython.keyboard.normalize_shortcut(pair[0]);
}, item);
this.test.assertEquals(result, item[1], 'Normalize shortcut: '+item[0]);
});
Paul Ivanov
use - for shortcut separators
r15873 });
Brian E. Granger
Adding basic tests for keyboard.js
r15617
this.then(function () {
this.each(normalized_shortcuts, function (self, item) {
var result = this.evaluate(function (sc) {
var e = IPython.keyboard.shortcut_to_event(sc);
var sc2 = IPython.keyboard.event_to_shortcut(e);
return sc2;
}, item);
this.test.assertEquals(result, item, 'Shortcut to event roundtrip: '+item);
});
});
Paul Ivanov
use - for shortcut separators
r15873 });