@basthon/browser-bundle 0.63.0 → 0.64.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/lib/{0.63.0 → 0.64.1}/python3/basthon.tar +0 -0
  2. package/lib/{0.63.0 → 0.64.1}/python3/modules/IPython-0.0.1-py3-none-any.whl +0 -0
  3. package/lib/{0.63.0/python3-old → 0.64.1/python3}/modules/graphviz-0.0.1-py3-none-any.whl +0 -0
  4. package/lib/{0.63.0/python3-old → 0.64.1/python3}/modules/p5-0.0.1-py3-none-any.whl +0 -0
  5. package/lib/{0.63.0/python3-old → 0.64.1/python3}/modules/proj4py-0.0.1-py3-none-any.whl +0 -0
  6. package/lib/{0.63.0/python3-old → 0.64.1/python3}/modules/rcviz-0.0.1-py3-none-any.whl +0 -0
  7. package/lib/{0.63.0 → 0.64.1}/python3/modules/requests-0.0.1-py3-none-any.whl +0 -0
  8. package/lib/{0.63.0 → 0.64.1}/python3/modules/turtle-0.0.1-py3-none-any.whl +0 -0
  9. package/lib/{0.63.0/python3-old → 0.64.1/python3}/modules/tutor-0.0.1-py3-none-any.whl +0 -0
  10. package/lib/{0.63.0 → 0.64.1}/python3/repodata.json +1 -1
  11. package/lib/bundle.js +1 -1
  12. package/lib/bundle.js.map +1 -1
  13. package/lib/kernel-base_lib_kernel_js-node_modules_babel_runtime_helpers_esm_get_js.js +1 -1
  14. package/lib/kernel-base_lib_kernel_js-node_modules_babel_runtime_helpers_esm_get_js.js.map +1 -1
  15. package/lib/kernel-base_lib_worker_index_js-_a2470.js.map +1 -1
  16. package/lib/kernel-base_lib_worker_index_js-_a2471.js +1 -1
  17. package/lib/kernel-base_lib_worker_index_js-_a2471.js.map +1 -1
  18. package/lib/kernel-base_lib_worker_kernel-worker_js-kernel-javascript_lib_comlink-worker_js.js +1 -1
  19. package/lib/kernel-base_lib_worker_kernel-worker_js-kernel-javascript_lib_comlink-worker_js.js.map +1 -1
  20. package/lib/kernel-base_lib_worker_kernel-worker_js-kernel-ocaml_lib_comlink-worker_js.js +1 -1
  21. package/lib/kernel-base_lib_worker_kernel-worker_js-kernel-ocaml_lib_comlink-worker_js.js.map +1 -1
  22. package/lib/kernel-base_lib_worker_kernel-worker_js-kernel-sql_lib_comlink-worker_js.js +1 -1
  23. package/lib/kernel-base_lib_worker_kernel-worker_js-kernel-sql_lib_comlink-worker_js.js.map +1 -1
  24. package/lib/kernel-python3_lib_index_js.js +1 -1
  25. package/lib/kernel-python3_lib_index_js.js.map +1 -1
  26. package/package.json +3 -3
  27. package/lib/0.63.0/python3/modules/extern/pytutor-main.min.css +0 -35
  28. package/lib/0.63.0/python3/modules/extern/pytutor-main.min.js +0 -2
  29. package/lib/0.63.0/python3/modules/extern/pytutor-main.min.js.LICENSE.txt +0 -31
  30. package/lib/0.63.0/python3/modules/extern/pytutor-main.min.js.map +0 -1
  31. package/lib/0.63.0/python3/modules/graphviz-0.0.1-py3-none-any.whl +0 -0
  32. package/lib/0.63.0/python3/modules/p5-0.0.1-py3-none-any.whl +0 -0
  33. package/lib/0.63.0/python3/modules/proj4py-0.0.1-py3-none-any.whl +0 -0
  34. package/lib/0.63.0/python3/modules/rcviz-0.0.1-py3-none-any.whl +0 -0
  35. package/lib/0.63.0/python3/modules/tutor-0.0.1-py3-none-any.whl +0 -0
  36. package/lib/0.63.0/python3-old/basthon.data +0 -0
  37. package/lib/0.63.0/python3-old/basthon.js +0 -1
  38. package/lib/0.63.0/python3-old/modules/IPython-0.0.1-py3-none-any.whl +0 -0
  39. package/lib/0.63.0/python3-old/modules/ipythonblocks-0.0.1-py3-none-any.whl +0 -0
  40. package/lib/0.63.0/python3-old/modules/ivp-0.0.1-py3-none-any.whl +0 -0
  41. package/lib/0.63.0/python3-old/modules/lolviz-0.0.1-py3-none-any.whl +0 -0
  42. package/lib/0.63.0/python3-old/modules/requests-0.0.1-py3-none-any.whl +0 -0
  43. package/lib/0.63.0/python3-old/modules/turtle-0.0.1-py3-none-any.whl +0 -0
  44. package/lib/kernel-python3-old_lib_index_js.js +0 -2
  45. package/lib/kernel-python3-old_lib_index_js.js.map +0 -1
  46. /package/lib/{0.63.0/python3-old → 0.64.1/python3}/modules/extern/pytutor-main.min.css +0 -0
  47. /package/lib/{0.63.0/python3-old → 0.64.1/python3}/modules/extern/pytutor-main.min.js +0 -0
  48. /package/lib/{0.63.0/python3-old → 0.64.1/python3}/modules/extern/pytutor-main.min.js.LICENSE.txt +0 -0
  49. /package/lib/{0.63.0/python3-old → 0.64.1/python3}/modules/extern/pytutor-main.min.js.map +0 -0
Binary file
@@ -1 +0,0 @@
1
- var Module=void 0!==pyodide._module?pyodide._module:{};Module.expectedDataFileDownloads||(Module.expectedDataFileDownloads=0,Module.finishedDataFileDownloads=0),Module.expectedDataFileDownloads++,function(e){if("object"==typeof window)window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/");else{if("undefined"==typeof location)throw"using preloaded data can only be done on a web page or in a web worker";encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}var a="basthon.data";"function"!=typeof Module.locateFilePackage||Module.locateFile||(Module.locateFile=Module.locateFilePackage,err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var o=Module.locateFile?Module.locateFile(a,""):a,t=e.remote_package_size;e.package_uuid;var d,l,n,s,i=null,u=Module.getPreloadedPackage?Module.getPreloadedPackage(o,t):null;function r(){function a(e,a){if(!e)throw a+(new Error).stack}function o(o){Module.finishedDataFileDownloads++,a(o,"Loading data file failed."),a(o instanceof ArrayBuffer,"bad input to processPackageData");var t=new Uint8Array(o),d={data:null,cachedOffset:34866,cachedIndexes:[-1,-1],cachedChunks:[null,null],offsets:[0,1043,2393,3661,4938,5670,6820,8137,9355,10626,11656,13081,14399,15643,16829,18034,19190,20425,21709,22947,24075,25342,26660,28065,29220,30531,31745,32888,34030],sizes:[1043,1350,1268,1277,732,1150,1317,1218,1271,1030,1425,1318,1244,1186,1205,1156,1235,1284,1238,1128,1267,1318,1405,1155,1311,1214,1143,1142,836],successes:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]};d.data=t,LZ4=Module.LZ4,a("object"==typeof LZ4,"LZ4 not present - was your app build with -s LZ4=1 ?"),LZ4.loadPackage({metadata:e,compressedData:d}),Module.removeRunDependency("datafile_lib/dist//basthon.data")}Module.FS_createPath("/","lib",!0,!0),Module.FS_createPath("/lib","python3.8",!0,!0),Module.FS_createPath("/lib/python3.8","site-packages",!0,!0),Module.FS_createPath("/lib/python3.8/site-packages","basthon",!0,!0),Module.addRunDependency("datafile_lib/dist//basthon.data"),Module.preloadResults||(Module.preloadResults={}),Module.preloadResults["lib/dist//basthon.data"]={fromCache:!1},u?(o(u),u=null):i=o}u||(d=o,l=t,n=function(e){i?(i(e),i=null):u=e},(s=new XMLHttpRequest).open("GET",d,!0),s.responseType="arraybuffer",s.onprogress=function(e){var a=d,o=l;if(e.total&&(o=e.total),e.loaded){s.addedTotal?Module.dataFileDownloads[a].loaded=e.loaded:(s.addedTotal=!0,Module.dataFileDownloads||(Module.dataFileDownloads={}),Module.dataFileDownloads[a]={loaded:e.loaded,total:o});var t=0,n=0,i=0;for(var u in Module.dataFileDownloads){var r=Module.dataFileDownloads[u];t+=r.total,n+=r.loaded,i++}t=Math.ceil(t*Module.expectedDataFileDownloads/i),Module.setStatus&&Module.setStatus("Downloading data... ("+n+"/"+t+")")}else Module.dataFileDownloads||Module.setStatus&&Module.setStatus("Downloading data...")},s.onerror=function(e){throw new Error("NetworkError for: "+d)},s.onload=function(e){if(!(200==s.status||304==s.status||206==s.status||0==s.status&&s.response))throw new Error(s.statusText+" : "+s.responseURL);var a=s.response;n(a)},s.send(null)),Module.calledRun?r():(Module.preRun||(Module.preRun=[]),Module.preRun.push(r))}({files:[{filename:"/lib/python3.8/site-packages/basthon/utils.py",start:0,end:2379,audio:0},{filename:"/lib/python3.8/site-packages/basthon/kernel.py",start:2379,end:6998,audio:0},{filename:"/lib/python3.8/site-packages/basthon/packages.py",start:6998,end:13615,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_pyodide_console.py",start:13615,end:25210,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_patch_modules.py",start:25210,end:37315,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_console.py",start:37315,end:42641,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_patch_builtins.py",start:42641,end:45140,audio:0},{filename:"/lib/python3.8/site-packages/basthon/__init__.py",start:45140,end:45478,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_pyodide_base.py",start:45478,end:58612,audio:0}],remote_package_size:38962,package_uuid:"3fad65d6-6ac9-4214-945a-dc7d10ba1bfb"});
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["kernel-python3-old_lib_index_js"],{9462:(e,n,t)=>{t.d(n,{z:()=>r.z});var r=t(3297)},5880:(e,n,t)=>{t.r(n),t.d(n,{Python3OldKernel:()=>v});var r=t(6330),o=t(5152),u=t(414),a=t(5309),i=t(2715),s=t(5018),c=t(9296),l=t(5799),p=t.n(l),f=t(9462);function _(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return d(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?d(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,a=!0,i=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){i=!0,u=e},f:function(){try{a||null==t.return||t.return()}finally{if(i)throw u}}}}function d(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function y(e,n,t,r){var o=(0,s.A)((0,i.A)(1&r?e.prototype:e),n,t);return 2&r&&"function"==typeof o?function(e){return o.apply(t,e)}:o}var v=function(e){function n(e){var t,r,u,s,c;return(0,o.A)(this,n),u=this,s=n,c=[e],s=(0,i.A)(s),(r=(0,a.A)(u,h()?Reflect.construct(s,c||[],(0,i.A)(u).constructor):s.apply(u,c)))._pyodideURLs=["https://cdn.jsdelivr.net/pyodide/v{PYODIDE_VERSION}/full/pyodide.js"],r.__kernel__=null,r.pythonVersion="",r._pyodideURLs.unshift("".concat(r.basthonRoot(),"/pyodide/pyodide.js")),r._pyodideURLs=null!==(t=null==e?void 0:e.pyodideURLs)&&void 0!==t?t:r._pyodideURLs,r}return(0,c.A)(n,e),(0,u.A)(n,[{key:"basthonModulesRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.basthonRoot(e)+"/modules"}},{key:"language",value:function(){return"python3-old"}},{key:"languageName",value:function(){return"Python 3 Old"}},{key:"moduleExts",value:function(){return["py"]}},{key:"_onload",value:(m=(0,r.A)(p().mark((function e(){var n,t;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=window.pyodide,this.pythonVersion=n.runPython("import platform ; platform.python_version()"),t=console.error,console.error=function(){},e.next=6,n.loadPackage(this.basthonRoot(!0)+"/basthon.js");case 6:return console.error=t,e.next=9,n.runPythonAsync("import basthon as __basthon__");case 9:return this.__kernel__=n.globals.__basthon__.__kernel__,e.next=12,n.runPythonAsync("del __basthon__");case 12:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"_init",value:(b=(0,r.A)(p().mark((function e(){var t,r,o,u;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y(n,"_init",this,3)([]);case 2:t=this._pyodideURLs[0],r=_(this._pyodideURLs),e.prev=4,r.s();case 6:if((o=r.n()).done){e.next=22;break}return u=(u=o.value).replace("{PYODIDE_VERSION}","0.16.1"),e.prev=9,e.next=12,fetch(u,{method:"HEAD"});case 12:if(!e.sent.ok){e.next=16;break}return t=u,e.abrupt("break",22);case 16:e.next=20;break;case 18:e.prev=18,e.t0=e.catch(9);case 20:e.next=6;break;case 22:e.next=27;break;case 24:e.prev=24,e.t1=e.catch(4),r.e(e.t1);case 27:return e.prev=27,r.f(),e.finish(27);case 30:return window.languagePluginUrl=t.substr(0,t.lastIndexOf("/"))+"/",e.prev=31,e.next=34,n.loadScript(t);case 34:e.next=41;break;case 36:throw e.prev=36,e.t2=e.catch(31),console.log(e.t2),console.error("Can't load pyodide.js"),e.t2;case 41:if(null!=window.languagePluginLoader){e.next=43;break}throw new Error("Can't load pyodide.js");case 43:return e.next=45,window.languagePluginLoader;case 45:return e.next=47,this._onload();case 47:case"end":return e.stop()}}),e,this,[[4,24,27,30],[9,18],[31,36]])}))),function(){return b.apply(this,arguments)})},{key:"execution_count",get:function(){return this.__kernel__.execution_count()}},{key:"evalAsync",value:(k=(0,r.A)(p().mark((function e(n,t,r){var o,u=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>3&&void 0!==u[3]?u[3]:null,void 0===t&&(t=function(e){console.log(e)}),void 0===r&&(r=function(e){console.error(e)}),e.next=5,this.__kernel__.eval(n,t,r,o);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,n,t){return k.apply(this,arguments)})},{key:"_start",value:(v=(0,r.A)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y(n,"_start",this,3)([]);case 2:return e.abrupt("return",this.__kernel__.start());case 3:case"end":return e.stop()}}),e,this)}))),function(){return v.apply(this,arguments)})},{key:"_stop",value:(d=(0,r.A)(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.__kernel__.stop(),e.next=3,y(n,"_stop",this,3)([]);case 3:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"putFile",value:(f=(0,r.A)(p().mark((function e(n,t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.__kernel__.put_file(n,t);case 1:case"end":return e.stop()}}),e,this)}))),function(e,n){return f.apply(this,arguments)})},{key:"putModule",value:(l=(0,r.A)(p().mark((function e(n,t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.__kernel__.put_module(n,t));case 1:case"end":return e.stop()}}),e,this)}))),function(e,n){return l.apply(this,arguments)})},{key:"userModules",value:function(){return this.__kernel__.user_modules()}},{key:"getFile",value:function(e){return this.__kernel__.get_file(e)}},{key:"getUserModuleFile",value:function(e){return this.__kernel__.get_user_module_file(e)}},{key:"more",value:(s=(0,r.A)(p().mark((function e(n){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.__kernel__.more(n));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"banner",value:function(){return'Python 3.8.2 (default, Dec 25 2020 21:20:57) on WebAssembly VM\nType "help", "copyright", "credits" or "license" for more information.'}},{key:"complete",value:(t=(0,r.A)(p().mark((function e(n){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.__kernel__.complete(n));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"chdir",value:function(e){window.pyodide._module.FS.chdir(e)}},{key:"mkdir",value:function(e){window.pyodide._module.FS.mkdir(e)}}]);var t,s,l,f,d,v,k,b,m}(f.z)}}]);
2
- //# sourceMappingURL=kernel-python3-old_lib_index_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GACF/E,OAAOL,QAAQkG,QAAQC,GAAGE,MAAMjB,EACpC,KApBA,IAAAS,EAjBAN,EAzBAV,EANAR,EAPAH,EAPAJ,EAjBAb,EAxCAlC,EApBAnB,CA+JC,CA7LwB,CAAS0G,EAAAA,E","sources":["webpack://@basthon/browser-bundle/../kernel-python3-old/lib/kernel.js"],"sourcesContent":["import { KernelBase } from \"@basthon/kernel-base\";\nconst PYODIDE_VERSION = \"0.16.1\";\n/**\n * A Python kernel that satisfies Basthon's API.\n */\nexport class Python3OldKernel extends KernelBase {\n constructor(options) {\n super(options);\n /**\n * Where to find pyodide.js (private).\n */\n this._pyodideURLs = [\n `https://cdn.jsdelivr.net/pyodide/v{PYODIDE_VERSION}/full/pyodide.js`,\n ];\n this.__kernel__ = null;\n this.pythonVersion = \"\";\n // for locally installed Pyodide\n this._pyodideURLs.unshift(`${this.basthonRoot()}/pyodide/pyodide.js`);\n this._pyodideURLs = options?.pyodideURLs ?? this._pyodideURLs;\n }\n /**\n * Get the URL of Basthon modules dir.\n */\n basthonModulesRoot(absolute = false) {\n return this.basthonRoot(absolute) + \"/modules\";\n }\n language() {\n return \"python3-old\";\n }\n languageName() {\n return \"Python 3 Old\";\n }\n moduleExts() {\n return [\"py\"];\n }\n /**\n * What to do when loaded (private).\n */\n async _onload() {\n const pyodide = window.pyodide;\n // get the version of Python from Python\n this.pythonVersion = pyodide.runPython(\"import platform ; platform.python_version()\");\n // this is for avoiding \"Unknown package 'basthon'\" error\n // but can be removed with 0.17.0 since it is fixed upstream\n const consoleErrorBck = console.error;\n console.error = () => { };\n await pyodide.loadPackage(this.basthonRoot(true) + \"/basthon.js\");\n console.error = consoleErrorBck;\n // importing basthon to get it's kernel\n await pyodide.runPythonAsync(\"import basthon as __basthon__\");\n // kernel lookup\n this.__kernel__ = pyodide.globals.__basthon__.__kernel__;\n // removing basthon from global namespace\n await pyodide.runPythonAsync(\"del __basthon__\");\n }\n /**\n * Start the Basthon kernel asynchronously.\n */\n async _init() {\n await super._init();\n let pyodideURL = this._pyodideURLs[0];\n for (let url of this._pyodideURLs) {\n url = url.replace(\"{PYODIDE_VERSION}\", PYODIDE_VERSION);\n try {\n const response = await fetch(url, { method: \"HEAD\" });\n if (response.ok) {\n pyodideURL = url;\n break;\n }\n }\n catch (e) { }\n }\n // forcing Pyodide to look at the right location for other files\n window.languagePluginUrl =\n pyodideURL.substr(0, pyodideURL.lastIndexOf(\"/\")) + \"/\";\n try {\n await Python3OldKernel.loadScript(pyodideURL);\n }\n catch (error) {\n console.log(error);\n console.error(\"Can't load pyodide.js\");\n throw error;\n }\n if (window.languagePluginLoader == null) {\n throw new Error(\"Can't load pyodide.js\");\n }\n await window.languagePluginLoader;\n await this._onload();\n }\n /**\n * Execution count getter overload.\n */\n get execution_count() {\n return this.__kernel__.execution_count();\n }\n /**\n * Basthon async code evaluation function.\n */\n async evalAsync(code, outCallback, errCallback, data = null) {\n if (typeof outCallback === \"undefined\") {\n outCallback = function (text) {\n console.log(text);\n };\n }\n if (typeof errCallback === \"undefined\") {\n errCallback = function (text) {\n console.error(text);\n };\n }\n // loading dependencies are loaded by eval\n return await this.__kernel__.eval(code, outCallback, errCallback, data);\n }\n /**\n * Start the kernel.\n */\n async _start() {\n await super._start();\n return this.__kernel__.start();\n }\n /**\n * Stop the kernel.\n */\n async _stop() {\n this.__kernel__.stop();\n await super._stop();\n }\n /**\n * Put a file on the local (emulated) filesystem.\n */\n async putFile(filename, content) {\n this.__kernel__.put_file(filename, content);\n }\n /**\n * Put an importable module on the local (emulated) filesystem\n * and load dependencies.\n */\n async putModule(filename, content) {\n return this.__kernel__.put_module(filename, content);\n }\n /**\n * List modules launched via putModule.\n */\n userModules() {\n return this.__kernel__.user_modules();\n }\n /**\n * Get a file content from the VFS.\n */\n getFile(path) {\n return this.__kernel__.get_file(path);\n }\n /**\n * Get a user module file content.\n */\n getUserModuleFile(filename) {\n return this.__kernel__.get_user_module_file(filename);\n }\n /**\n * Is the source ready to be evaluated or want we more?\n * Usefull to set ps1/ps2 for teminal prompt.\n */\n async more(source) {\n return this.__kernel__.more(source);\n }\n /**\n * Mimic the CPython's REPL banner.\n */\n banner() {\n /* We don't return this.__kernel__.banner();\n * since the banner should be available ASAP.\n * In tests, we check this.banner() === this.__kernel__.banner().\n */\n return `Python 3.8.2 (default, Dec 25 2020 21:20:57) on WebAssembly VM\\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.`;\n }\n /**\n * Complete a code at the end (usefull for tab completion).\n *\n * Returns an array of two elements: the list of completions\n * and the start index.\n */\n async complete(code) {\n return this.__kernel__.complete(code);\n }\n /**\n * Change current directory (Python's virtual FS).\n */\n chdir(path) {\n window.pyodide._module.FS.chdir(path);\n }\n /**\n * Create directory (Python's virtual FS).\n */\n mkdir(path) {\n window.pyodide._module.FS.mkdir(path);\n }\n}\n"],"names":["Python3OldKernel","_KernelBase","options","_options$pyodideURLs","_this","_classCallCheck","_pyodideURLs","__kernel__","pythonVersion","unshift","concat","basthonRoot","pyodideURLs","_inherits","_createClass","key","value","absolute","arguments","length","undefined","this","_onload2","_asyncToGenerator","_regeneratorRuntime","_callee","pyodide","consoleErrorBck","_context","prev","next","window","runPython","console","error","loadPackage","runPythonAsync","globals","__basthon__","stop","apply","_init2","_callee2","pyodideURL","_iterator","_step","url","_context2","_superPropGet","_createForOfIteratorHelper","s","n","done","replace","fetch","method","sent","ok","abrupt","t0","t1","e","f","finish","languagePluginUrl","substr","lastIndexOf","loadScript","t2","log","languagePluginLoader","Error","_onload","get","execution_count","_evalAsync","_callee3","code","outCallback","errCallback","data","_args3","_context3","text","eval","_x","_x2","_x3","_start2","_callee4","_context4","start","_stop2","_callee5","_context5","_putFile","_callee6","filename","content","_context6","put_file","_x4","_x5","_putModule","_callee7","_context7","put_module","_x6","_x7","user_modules","path","get_file","get_user_module_file","_more","_callee8","source","_context8","more","_x8","_complete","_callee9","_context9","complete","_x9","_module","FS","chdir","mkdir","KernelBase"],"sourceRoot":""}