From e12a5c3b130416070a302d2ac9b54b61b174bd42 Mon Sep 17 00:00:00 2001 From: pmp-p Date: Thu, 6 Oct 2022 19:11:17 +0200 Subject: [PATCH] 0.4 testing --- static/default.tmpl | 11 ++++++----- static/pythons.js | 37 ++++++------------------------------- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/static/default.tmpl b/static/default.tmpl index ef590fb..0d83209 100644 --- a/static/default.tmpl +++ b/static/default.tmpl @@ -97,10 +97,11 @@ async def sitecustomize(): "mount" : { "point" : appdir.as_posix(), "path" : "/", - } - + }, + "path" : f"/ => {appdir.as_posix()}", } + track = platform.window.MM.prepare(apk, json.dumps(cfg)) marginx = ux(.020) # 20% @@ -257,9 +258,9 @@ config = { - - - + + + diff --git a/static/pythons.js b/static/pythons.js index f924d98..5f5061b 100644 --- a/static/pythons.js +++ b/static/pythons.js @@ -276,33 +276,6 @@ function prerun(VM) { VM.FS.init(stdin, stdout, stderr); } -/* -async function _rcp(url, store) { - var content - - store = store || ( "/data/data/" + url ) - - - try { - content = await fetch(url, {}) - } catch (x) { - console.error(__FILE__,`cannot rcp ${url} to ${store}`, x) - return false - } - - console.info(__FILE__,`rcp ${url} => ${store}`, content.status) - - if (content.ok) { - const text= await content.text() - await vm.FS.writeFile( store, text); - return true; - } else { - console.error(__FILE__,`cannot rcp ${url} to ${store}`) - return false - } -} - -*/ const vm = { APK : "org.python", @@ -763,7 +736,7 @@ async function feat_vtx(debug_hidden) { const { WasmTerminal } = await import("./vtx.js") vm.vt = new WasmTerminal("terminal", 132, 42, [ - { url : "./xtermjsixel/xterm-addon-image-worker.js", sixelSupport:true } + { url : config.cdn+"xtermjsixel/xterm-addon-image-worker.js", sixelSupport:true } ] ) } @@ -1318,8 +1291,10 @@ function MM_autoevents(track) { } -window.cross_dl = async function cross_dl(trackid, url, autoready) { - var response = await fetch(url, FETCH_FLAGS); +window.cross_dl = async function cross_dl(trackid, url, flags) { + var response = await fetch(url, flags || FETCH_FLAGS); + + checkStatus(response) const reader = response.body.getReader(); @@ -1409,7 +1384,7 @@ MM.prepare = function prepare(url, cfg) { track.avail = true } else { console.log("MM.cross_dl", trackid, transport, type, url ) - cross_dl(trackid, url) + cross_dl(trackid, url, {} ) } }