add array of initializers, to run after the python runtime has loaded

This commit is contained in:
Fabio Pliger
2022-03-25 16:57:54 -05:00
parent 3d613b8904
commit 2b7cbe0129
5 changed files with 141 additions and 17 deletions

View File

@@ -6,7 +6,7 @@ import { keymap, ViewUpdate } from "@codemirror/view";
import { defaultKeymap } from "@codemirror/commands";
import { oneDarkTheme } from "@codemirror/theme-one-dark";
import { pyodideLoaded, loadedEnvironments, componentDetailsNavOpen, currentComponentDetails, mode, addToScriptsQueue } from '../stores';
import { pyodideLoaded, loadedEnvironments, componentDetailsNavOpen, currentComponentDetails, mode } from '../stores';
import { addClasses } from '../utils';
// Premise used to connect to the first available pyodide interpreter
@@ -208,7 +208,7 @@ export class PyRepl extends HTMLElement {
let source = this.editor.state.doc.toString();
let output;
if (source.includes("asyncio")){
output = pyodide.runPythonAsync(source);
output = await pyodide.runPythonAsync(source);
}else{
output = pyodide.runPython(source);
}