Skip to content

Commit

Permalink
Added __terminal__ in non-persistent donkey (pyscript#2260)
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection authored Dec 6, 2024
1 parent 0d74a60 commit d143b22
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 86 deletions.
179 changes: 97 additions & 82 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pyscript/core",
"version": "0.6.20",
"version": "0.6.22",
"type": "module",
"description": "PyScript",
"module": "./index.js",
Expand Down Expand Up @@ -63,7 +63,7 @@
"add-promise-listener": "^0.1.3",
"basic-devtools": "^0.1.6",
"polyscript": "^0.16.10",
"sabayon": "^0.6.0",
"sabayon": "^0.6.1",
"sticky-module": "^0.1.1",
"to-json-callback": "^0.1.1",
"type-checked-collections": "^0.1.7"
Expand All @@ -88,7 +88,7 @@
"codemirror": "^6.0.1",
"eslint": "^9.16.0",
"flatted": "^3.3.2",
"rollup": "^4.28.0",
"rollup": "^4.28.1",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-string": "^3.0.0",
"static-handler": "^0.5.3",
Expand Down
3 changes: 2 additions & 1 deletion core/src/plugins/donkey.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const { stringify } = JSON;
const invoke = (name, args) => `${name}(code, ${args.join(", ")})`;

const donkey = ({ type = "py", persistent, terminal, config }) => {
const args = persistent ? ["globals()", "__locals__"] : ["{}", "{}"];
const globals = terminal ? '{"__terminal__":__terminal__}' : "{}";
const args = persistent ? ["globals()", "__locals__"] : [globals, "{}"];

const src = URL.createObjectURL(
new Blob([
Expand Down

0 comments on commit d143b22

Please sign in to comment.