mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 18:55:29 -05:00
Moves Python code out of interpreter file (#207)
* make copy of .py files part of build process * move code out ofinterpreter file and make it download and load code during initialization * fix double ; in interpreter * remove debugging print * update dependencies * fix project name and version * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * lint * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * change fmt-py * lint * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove extra content * define missing strict type * create build folder if doesn't exist Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -6,7 +6,6 @@ let environments;
|
||||
let currentMode;
|
||||
let Element;
|
||||
|
||||
|
||||
pyodideLoaded.subscribe(value => {
|
||||
runtime = value;
|
||||
});
|
||||
@@ -14,7 +13,6 @@ loadedEnvironments.subscribe(value => {
|
||||
environments = value;
|
||||
});
|
||||
|
||||
|
||||
mode.subscribe(value => {
|
||||
currentMode = value;
|
||||
});
|
||||
@@ -145,9 +143,9 @@ export class BaseEvalElement extends HTMLElement {
|
||||
Element = pyodide.globals.get('Element');
|
||||
}
|
||||
const out = Element(this.errorElement.id);
|
||||
|
||||
|
||||
addClasses(this.errorElement, ['bg-red-200', 'p-2']);
|
||||
out.write.callKwargs(err, { append : true});
|
||||
out.write.callKwargs(err, { append: true });
|
||||
this.errorElement.hidden = false;
|
||||
this.errorElement.style.display = 'block';
|
||||
}
|
||||
@@ -203,8 +201,8 @@ function createWidget(name: string, code: string, klass: string) {
|
||||
// });
|
||||
// }, 2000);
|
||||
pyodideLoaded.subscribe(value => {
|
||||
console.log("RUNTIME READY", value)
|
||||
if ("runPythonAsync" in value){
|
||||
console.log('RUNTIME READY', value);
|
||||
if ('runPythonAsync' in value) {
|
||||
runtime = value;
|
||||
setTimeout(() => {
|
||||
this.eval(this.code).then(() => {
|
||||
|
||||
Reference in New Issue
Block a user