File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,19 +5,31 @@ export default class LearnPython3Plugin {
55 }
66
77 afterPyScriptExec ( opt ) {
8- console . log ( opt ) ;
98 let
109 tag = opt . pyScriptTag ,
1110 outputId = tag . getAttribute ( 'output' ) ,
1211 $btn = $ ( 'button[outputId=' + outputId + ']' ) ,
1312 $i = $btn . find ( 'i' ) ;
14- $i . removeClass ( 'uk-icon-spinner' ) ;
15- $i . removeClass ( 'uk-icon-spin' ) ;
13+ $i . removeClass ( 'uk-icon-spinner' ) ;
14+ $i . removeClass ( 'uk-icon-spin' ) ;
1615 $btn . removeAttr ( 'disabled' ) ;
16+ let err = $ ( tag ) . find ( 'pre.py-error' ) . text ( ) ;
17+ if ( err ) {
18+ let
19+ $out = $ ( '#' + outputId ) ,
20+ s = $out . text ( ) ;
21+ if ( s ) {
22+ s = s + '\n' + err ;
23+ } else {
24+ s = err ;
25+ }
26+ $out . text ( s ) ;
27+ $out . addClass ( 'uk-alert-danger' ) ;
28+ }
1729 }
1830
1931 onUserError ( err ) {
20- console . log ( 'Error >>>' ) ;
32+ console . log ( 'Error >>>' ) ;
2133 console . error ( err ) ;
2234 }
2335}
You can’t perform that action at this time.
0 commit comments