File tree Expand file tree Collapse file tree 8 files changed +40
-2
lines changed
src/jupyter_contrib_nbextensions/nbextensions/code_prettify Expand file tree Collapse file tree 8 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ Parameters:
38
38
input_type : hotkey
39
39
default : ' Ctrl-Shift-M'
40
40
41
+ - name : 2to3.show_alerts_for_not_supported_kernel
42
+ description : Show alerts if the kernel is not supported
43
+ input_type : checkbox
44
+ default : false
45
+
41
46
- name : 2to3.show_alerts_for_errors
42
47
description : Show alerts for errors in the kernel converting calls
43
48
input_type : checkbox
Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ The options are as follows:
59
59
Hotkey to use to transform the selected cell(s).
60
60
Defaults to ` Ctrl-L ` .
61
61
62
+ - ` 2to3.show_alerts_for_not_supported_kernel ` :
63
+ Whether to show alerts if the kernel is not supported.
64
+ Defaults to ` false ` .
65
+
62
66
- ` 2to3.show_alerts_for_errors ` :
63
67
Whether to show alerts for errors in the kernel calls.
64
68
Defaults to ` true ` .
Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ The options are as follows:
65
65
Hotkey to use to transform the selected cell(s).
66
66
Defaults to ` Alt-A ` .
67
67
68
+ - ` autopep8.show_alerts_for_not_supported_kernel ` :
69
+ Whether to show alerts if the kernel is not supported.
70
+ Defaults to ` false ` .
71
+
68
72
- ` autopep8.show_alerts_for_errors ` :
69
73
Whether to show alerts for errors in the kernel calls.
70
74
Defaults to ` true ` .
Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ The options are as follows:
114
114
Hotkey to use to transform the selected cell(s).
115
115
Defaults to ` Ctrl-L ` .
116
116
117
+ - ` code_prettify.show_alerts_for_not_supported_kernel ` :
118
+ Whether to show alerts if the kernel is not supported.
119
+ Defaults to ` false ` .
120
+
117
121
- ` code_prettify.show_alerts_for_errors ` :
118
122
Whether to show alerts for errors in the kernel calls.
119
123
Defaults to ` true ` .
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ All options are provided by the [KerneExecOnCells library](kernel_exec_on_cell.j
25
25
See [ fontawesome] for available icon classes.
26
26
Defaults to ` fa-sort ` .
27
27
28
+ - ` isort.show_alerts_for_not_supported_kernel ` :
29
+ Whether to show alerts if the kernel is not supported.
30
+ Defaults to ` false ` .
31
+
28
32
- ` isort.show_alerts_for_errors ` : Whether to show alerts for errors in the kernel calls. Defaults to ` false ` .
29
33
30
34
- ` isort.button_label ` : Toolbar button label text. Also used in the actions' help text. Defaults to ` Sort imports with isort ` .
Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ Parameters:
41
41
input_type : hotkey
42
42
default : ' Alt-Shift-A'
43
43
44
+ - name : autopep8.show_alerts_for_not_supported_kernel
45
+ description : Show alerts if the kernel is not supported
46
+ input_type : checkbox
47
+ default : false
48
+
44
49
- name : autopep8.show_alerts_for_errors
45
50
description : Show alerts for errors in the kernel prettifying calls
46
51
input_type : checkbox
Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ Parameters:
41
41
input_type : hotkey
42
42
default : ' Ctrl-Shift-L'
43
43
44
+ - name : code_prettify.show_alerts_for_not_supported_kernel
45
+ description : Show alerts if the kernel is not supported
46
+ input_type : checkbox
47
+ default : false
48
+
44
49
- name : code_prettify.show_alerts_for_errors
45
50
description : Show alerts for errors in the kernel prettifying calls
46
51
input_type : checkbox
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ define([
39
39
} ,
40
40
register_hotkey : true ,
41
41
show_alerts_for_errors : true ,
42
+ show_alerts_for_not_supported_kernel : false ,
42
43
button_icon : 'fa-legal' ,
43
44
button_label : mod_name ,
44
45
kbd_shortcut_text : mod_name ,
@@ -258,10 +259,16 @@ define([
258
259
var kernel_config = this . cfg . kernel_config_map [ kernelLanguage ] ;
259
260
if ( kernel_config === undefined ) {
260
261
$ ( '#' + this . mod_name + '_button' ) . remove ( ) ;
261
- alert ( this . mod_log_prefix + " Sorry, can't use kernel language " + kernelLanguage + ".\n" +
262
+ var err = this . mod_log_prefix + " Sorry, can't use kernel language " + kernelLanguage + ".\n" +
262
263
"Configurations are currently only defined for the following languages:\n" +
263
264
Object . keys ( this . cfg . kernel_config_map ) . join ( ', ' ) + "\n" +
264
- "See readme for more details." ) ;
265
+ "See readme for more details."
266
+ if ( this . cfg . show_alerts_for_not_supported_kernel ) {
267
+ alert ( err ) ;
268
+ }
269
+ else {
270
+ console . error ( err ) ;
271
+ }
265
272
// also remove keyboard shortcuts
266
273
if ( this . cfg . register_hotkey ) {
267
274
try {
You can’t perform that action at this time.
0 commit comments