##// END OF EJS Templates
Current state with lots and lots of debugging junk
Jonathan Frederic -
Show More
@@ -97,7 +97,12 b' define(['
97 // Make sure the view creation is not out of order with
97 // Make sure the view creation is not out of order with
98 // any state updates.
98 // any state updates.
99 model.state_change = model.state_change.then(function() {
99 model.state_change = model.state_change.then(function() {
100 console.log('create_view ' + model.id);
100 try {
101 console.log('create_view ' + model.id);
102 console.log(' _view_name ' + model.get('_view_name'));
103 console.log(' _view_module ' + model.get('_view_module'));
104 } catch (e) { }
105
101 return utils.load_class(model.get('_view_name'), model.get('_view_module'),
106 return utils.load_class(model.get('_view_name'), model.get('_view_module'),
102 WidgetManager._view_types).then(function(ViewType) {
107 WidgetManager._view_types).then(function(ViewType) {
103
108
@@ -70,6 +70,7 b' define(["widgets/js/manager",'
70 _handle_comm_msg: function (msg) {
70 _handle_comm_msg: function (msg) {
71 // Handle incoming comm msg.
71 // Handle incoming comm msg.
72 var method = msg.content.data.method;
72 var method = msg.content.data.method;
73 console.log(method);
73 var that = this;
74 var that = this;
74 switch (method) {
75 switch (method) {
75 case 'update':
76 case 'update':
@@ -81,8 +82,9 b' define(["widgets/js/manager",'
81 this.trigger('msg:custom', msg.content.data.content);
82 this.trigger('msg:custom', msg.content.data.content);
82 break;
83 break;
83 case 'display':
84 case 'display':
84 that.widget_manager.display_view(msg, that)
85 this.state_change = this.state_change.then(function() {
85 .catch(utils.reject("Couldn't process display msg for model id '" + String(that.id) + "'", true));
86 return that.widget_manager.display_view(msg, that);
87 }).catch(utils.reject("Couldn't process display msg for model id '" + String(that.id) + "'", true));
86 break;
88 break;
87 }
89 }
88 },
90 },
@@ -99,6 +101,7 b' define(["widgets/js/manager",'
99 } finally {
101 } finally {
100 that.state_lock = null;
102 that.state_lock = null;
101 }
103 }
104 return rsvp.Promise.resolve();
102 }, utils.reject("Couldn't set model state", true));
105 }, utils.reject("Couldn't set model state", true));
103 },
106 },
104
107
@@ -150,7 +150,7 b' define(['
150 this.$label.hide();
150 this.$label.hide();
151 } else {
151 } else {
152 this.$label.text(description);
152 this.$label.text(description);
153 MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
153 // MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
154 this.$label.show();
154 this.$label.show();
155 }
155 }
156
156
@@ -308,7 +308,7 b' define(['
308 this.$label.hide();
308 this.$label.hide();
309 } else {
309 } else {
310 this.$label.text(description);
310 this.$label.text(description);
311 MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
311 // MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
312 this.$label.show();
312 this.$label.show();
313 }
313 }
314 }
314 }
@@ -416,7 +416,7 b' define(['
416 this.$label.hide();
416 this.$label.hide();
417 } else {
417 } else {
418 this.$label.text(description);
418 this.$label.text(description);
419 MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
419 // MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
420 this.$label.show();
420 this.$label.show();
421 }
421 }
422 return ProgressView.__super__.update.apply(this);
422 return ProgressView.__super__.update.apply(this);
@@ -94,7 +94,7 b' define(['
94 this.$label.hide();
94 this.$label.hide();
95 } else {
95 } else {
96 this.$label.text(description);
96 this.$label.text(description);
97 MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
97 // MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
98 this.$label.show();
98 this.$label.show();
99 }
99 }
100 }
100 }
@@ -219,7 +219,7 b' define(['
219 this.$label.hide();
219 this.$label.hide();
220 } else {
220 } else {
221 this.$label.text(description);
221 this.$label.text(description);
222 MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
222 // MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
223 this.$label.show();
223 this.$label.show();
224 }
224 }
225 }
225 }
@@ -326,7 +326,7 b' define(['
326 this.$label.hide();
326 this.$label.hide();
327 } else {
327 } else {
328 this.$label.text(description);
328 this.$label.text(description);
329 MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
329 // MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
330 this.$label.show();
330 this.$label.show();
331 }
331 }
332 }
332 }
@@ -441,7 +441,7 b' define(['
441 this.$label.hide();
441 this.$label.hide();
442 } else {
442 } else {
443 this.$label.text(description);
443 this.$label.text(description);
444 MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
444 // MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
445 this.$label.show();
445 this.$label.show();
446 }
446 }
447 }
447 }
@@ -101,7 +101,7 b' define(['
101 this.$label.hide();
101 this.$label.hide();
102 } else {
102 } else {
103 this.$label.text(description);
103 this.$label.text(description);
104 MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
104 // MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
105 this.$label.show();
105 this.$label.show();
106 }
106 }
107 }
107 }
@@ -177,7 +177,7 b' define(['
177 this.$label.hide();
177 this.$label.hide();
178 } else {
178 } else {
179 this.$label.text(description);
179 this.$label.text(description);
180 MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
180 // MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$label.get(0)]);
181 this.$label.show();
181 this.$label.show();
182 }
182 }
183 }
183 }
@@ -744,4 +744,26 b' casper.capture_log = function () {'
744 });
744 });
745 };
745 };
746
746
747 casper.interact = function() {
748 // Start an interactive Javascript console.
749 var system = require('system');
750 system.stdout.writeLine('JS interactive console.');
751 system.stdout.writeLine('Type `exit` to quit.');
752
753 function read_line() {
754 system.stdout.writeLine('JS: ');
755 var line = system.stdin.readLine();
756 return line;
757 }
758
759 var input = read_line();
760 while (input.trim() != 'exit') {
761 var output = this.evaluate(function(code) {
762 return String(eval(code));
763 }, {code: input});
764 system.stdout.writeLine('\nOut: ' + output);
765 input = read_line();
766 }
767 };
768
747 casper.capture_log();
769 casper.capture_log();
@@ -13,7 +13,6 b' casper.notebook_test(function () {'
13 'display(bool_widgets[1])\n' +
13 'display(bool_widgets[1])\n' +
14 'print("Success")');
14 'print("Success")');
15 this.execute_cell_then(bool_index, function(index){
15 this.execute_cell_then(bool_index, function(index){
16
17 this.test.assertEquals(this.get_output_cell(index).text, 'Success\n',
16 this.test.assertEquals(this.get_output_cell(index).text, 'Success\n',
18 'Create bool widget cell executed with correct output.');
17 'Create bool widget cell executed with correct output.');
19
18
@@ -48,7 +47,6 b' casper.notebook_test(function () {'
48 this.test.assert(this.cell_element_function(index,
47 this.test.assert(this.cell_element_function(index,
49 '.widget-area .widget-subarea button', 'hasClass', ['active']),
48 '.widget-area .widget-subarea button', 'hasClass', ['active']),
50 'Toggle button is toggled.');
49 'Toggle button is toggled.');
51
52 });
50 });
53
51
54 index = this.append_cell(
52 index = this.append_cell(
@@ -57,6 +55,8 b' casper.notebook_test(function () {'
57 'print("Success")');
55 'print("Success")');
58 this.execute_cell_then(index, function(index){
56 this.execute_cell_then(index, function(index){
59
57
58 this.interact();
59
60 this.test.assertEquals(this.get_output_cell(index).text, 'Success\n',
60 this.test.assertEquals(this.get_output_cell(index).text, 'Success\n',
61 'Change bool widget value cell executed with correct output.');
61 'Change bool widget value cell executed with correct output.');
62
62
General Comments 0
You need to be logged in to leave comments. Login now