File tree 1 file changed +17
-12
lines changed
1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -56,18 +56,23 @@ <h1>Schemascii Playground</h1>
56
56
var render_button = document . getElementById ( "render" ) ;
57
57
var schemascii ;
58
58
async function main ( ) {
59
- info ( "Loading Python... " ) ;
60
- pyodide = await loadPyodide ( { stdout : info , stderr : error } ) ;
61
- info ( "done\n" ) ;
62
- info ( "Fetching current Schemascii version... " ) ;
63
- var pyproject_toml = await fetch ( "pyproject.toml" ) . then ( x => x . text ( ) ) ;
64
- var ver = / v e r s i o n = " ( [ \d . ] + ) " / . exec ( pyproject_toml ) [ 1 ] ;
65
- info ( ver + "\n" ) ;
66
- info ( `Installing schemascii-${ ver } ... ` ) ;
67
- await pyodide . runPythonAsync ( `import micropip\nawait micropip.install("https://dragoncoder047.github.io/schemascii/dist/schemascii-${ ver } -py3-none-any.whl")` ) ;
68
- schemascii = pyodide . pyimport ( "schemascii" ) ;
69
- setup ( ) ;
70
- console . textContent = "ready\n" ;
59
+ try {
60
+ info ( "Loading Python... " ) ;
61
+ pyodide = await loadPyodide ( { stdout : info , stderr : error } ) ;
62
+ info ( "done\n" ) ;
63
+ info ( "Fetching current Schemascii version... " ) ;
64
+ var pyproject_toml = await fetch ( "pyproject.toml" ) . then ( x => x . text ( ) ) ;
65
+ var ver = / v e r s i o n = " ( [ \d . ] + ) " / . exec ( pyproject_toml ) [ 1 ] ;
66
+ info ( ver + "\n" ) ;
67
+ info ( `Installing schemascii-${ ver } ... ` ) ;
68
+ await pyodide . runPythonAsync ( `import micropip\nawait micropip.install("https://dragoncoder047.github.io/schemascii/dist/schemascii-${ ver } -py3-none-any.whl")` ) ;
69
+ schemascii = pyodide . pyimport ( "schemascii" ) ;
70
+ setup ( ) ;
71
+ console . textContent = "ready\n" ;
72
+ } catch ( e ) {
73
+ error ( `\nJS Error:\n${ e . stack } \n` ) ;
74
+ throw e ;
75
+ }
71
76
}
72
77
function info ( line ) {
73
78
console . textContent += line ;
You can’t perform that action at this time.
0 commit comments