-
Notifications
You must be signed in to change notification settings - Fork 4
/
py.js
1 lines (1 loc) · 10.9 KB
/
py.js
1
var Module=typeof pyodide._module!=="undefined"?pyodide._module:{};Module.checkABI(1);if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0;Module.finishedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){var loadPackage=function(metadata){var PACKAGE_PATH;if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}else if(typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}else{throw"using preloaded data can only be done on a web page or in a web worker"}var PACKAGE_NAME="py.data";var REMOTE_PACKAGE_BASE="py.data";if(typeof Module["locateFilePackage"]==="function"&&!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 REMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata.remote_package_size;var PACKAGE_UUID=metadata.package_uuid;function fetchRemotePackage(packageName,packageSize,callback,errback){var xhr=new XMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=function(event){var url=packageName;var size=packageSize;if(event.total)size=event.total;if(event.loaded){if(!xhr.addedTotal){xhr.addedTotal=true;if(!Module.dataFileDownloads)Module.dataFileDownloads={};Module.dataFileDownloads[url]={loaded:event.loaded,total:size}}else{Module.dataFileDownloads[url].loaded=event.loaded}var total=0;var loaded=0;var num=0;for(var download in Module.dataFileDownloads){var data=Module.dataFileDownloads[download];total+=data.total;loaded+=data.loaded;num++}total=Math.ceil(total*Module.expectedDataFileDownloads/num);if(Module["setStatus"])Module["setStatus"]("Downloading data... ("+loaded+"/"+total+")")}else if(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}};xhr.onerror=function(event){throw new Error("NetworkError for: "+packageName)};xhr.onload=function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){var packageData=xhr.response;callback(packageData)}else{throw new Error(xhr.statusText+" : "+xhr.responseURL)}};xhr.send(null)}function handleError(error){console.error("package error:",error)}var fetchedCallback=null;var fetched=Module["getPreloadedPackage"]?Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE):null;if(!fetched)fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE,function(data){if(fetchedCallback){fetchedCallback(data);fetchedCallback=null}else{fetched=data}},handleError);function runWithFS(){function assert(check,msg){if(!check)throw msg+(new Error).stack}Module["FS_createPath"]("/","lib",true,true);Module["FS_createPath"]("/lib","python3.7",true,true);Module["FS_createPath"]("/lib/python3.7","site-packages",true,true);Module["FS_createPath"]("/lib/python3.7/site-packages","py",true,true);Module["FS_createPath"]("/lib/python3.7/site-packages/py","_vendored_packages",true,true);Module["FS_createPath"]("/lib/python3.7/site-packages/py","_path",true,true);Module["FS_createPath"]("/lib/python3.7/site-packages/py","_code",true,true);Module["FS_createPath"]("/lib/python3.7/site-packages/py","_io",true,true);Module["FS_createPath"]("/lib/python3.7/site-packages/py","_process",true,true);Module["FS_createPath"]("/lib/python3.7/site-packages/py","_log",true,true);Module["FS_createPath"]("/lib/python3.7/site-packages","py-1.8.0-py3.7.egg-info",true,true);function DataRequest(start,end,audio){this.start=start;this.end=end;this.audio=audio}DataRequest.prototype={requests:{},open:function(mode,name){this.name=name;this.requests[name]=this;Module["addRunDependency"]("fp "+this.name)},send:function(){},onload:function(){var byteArray=this.byteArray.subarray(this.start,this.end);this.finish(byteArray)},finish:function(byteArray){var that=this;Module["FS_createPreloadedFile"](this.name,null,byteArray,true,true,function(){Module["removeRunDependency"]("fp "+that.name)},function(){if(that.audio){Module["removeRunDependency"]("fp "+that.name)}else{err("Preloading file "+that.name+" failed")}},false,true);this.requests[this.name]=null}};function processPackageData(arrayBuffer){Module.finishedDataFileDownloads++;assert(arrayBuffer,"Loading data file failed.");assert(arrayBuffer instanceof ArrayBuffer,"bad input to processPackageData");var byteArray=new Uint8Array(arrayBuffer);var curr;var compressedData={data:null,cachedOffset:153846,cachedIndexes:[-1,-1],cachedChunks:[null,null],offsets:[0,1251,2553,3592,4425,5572,7010,8181,9369,10684,11736,13031,14029,14980,16281,17476,18531,19718,20984,22190,23269,24462,25762,26995,28225,29337,30539,31707,32934,34049,35310,36455,37789,38834,39859,40759,41793,43055,44267,45453,46554,47602,48865,49962,51195,52282,53516,54771,55908,57115,58218,59309,60374,61559,62718,63635,64763,65886,67162,68239,69441,70435,71667,72764,73733,75059,76227,77404,78407,79630,80652,82101,83340,84752,85877,86743,87527,88478,89433,90430,91613,93074,94348,95599,96774,97988,99141,100339,101540,102717,103858,104946,106095,107248,108145,109122,110386,111566,112586,113456,114346,115329,116507,117572,118732,120011,121265,122616,124003,125220,126415,127539,128772,129777,130875,132022,133431,134454,135738,136963,137953,138889,139971,141164,142521,143799,144849,146114,147361,148553,149676,150861,151633,152742,153845],sizes:[1251,1302,1039,833,1147,1438,1171,1188,1315,1052,1295,998,951,1301,1195,1055,1187,1266,1206,1079,1193,1300,1233,1230,1112,1202,1168,1227,1115,1261,1145,1334,1045,1025,900,1034,1262,1212,1186,1101,1048,1263,1097,1233,1087,1234,1255,1137,1207,1103,1091,1065,1185,1159,917,1128,1123,1276,1077,1202,994,1232,1097,969,1326,1168,1177,1003,1223,1022,1449,1239,1412,1125,866,784,951,955,997,1183,1461,1274,1251,1175,1214,1153,1198,1201,1177,1141,1088,1149,1153,897,977,1264,1180,1020,870,890,983,1178,1065,1160,1279,1254,1351,1387,1217,1195,1124,1233,1005,1098,1147,1409,1023,1284,1225,990,936,1082,1193,1357,1278,1050,1265,1247,1192,1123,1185,772,1109,1103,1],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,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,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,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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0]};compressedData.data=byteArray;assert(typeof Module.LZ4==="object","LZ4 not present - was your app build with -s LZ4=1 ?");Module.LZ4.loadPackage({metadata:metadata,compressedData:compressedData});Module["removeRunDependency"]("datafile_py.data")}Module["addRunDependency"]("datafile_py.data");if(!Module.preloadResults)Module.preloadResults={};Module.preloadResults[PACKAGE_NAME]={fromCache:false};if(fetched){processPackageData(fetched);fetched=null}else{fetchedCallback=processPackageData}}if(Module["calledRun"]){runWithFS()}else{if(!Module["preRun"])Module["preRun"]=[];Module["preRun"].push(runWithFS)}};loadPackage({files:[{filename:"/lib/python3.7/site-packages/py/test.py",start:0,end:222,audio:0},{filename:"/lib/python3.7/site-packages/py/__metainfo.py",start:222,end:277,audio:0},{filename:"/lib/python3.7/site-packages/py/_error.py",start:277,end:3194,audio:0},{filename:"/lib/python3.7/site-packages/py/__init__.py",start:3194,end:9216,audio:0},{filename:"/lib/python3.7/site-packages/py/_xmlgen.py",start:9216,end:17580,audio:0},{filename:"/lib/python3.7/site-packages/py/_builtin.py",start:17580,end:21601,audio:0},{filename:"/lib/python3.7/site-packages/py/_std.py",start:21601,end:22232,audio:0},{filename:"/lib/python3.7/site-packages/py/_version.py",start:22232,end:22348,audio:0},{filename:"/lib/python3.7/site-packages/py/_vendored_packages/__init__.py",start:22348,end:22348,audio:0},{filename:"/lib/python3.7/site-packages/py/_vendored_packages/iniconfig.py",start:22348,end:27556,audio:0},{filename:"/lib/python3.7/site-packages/py/_vendored_packages/apipkg.py",start:27556,end:33976,audio:0},{filename:"/lib/python3.7/site-packages/py/_path/__init__.py",start:33976,end:34008,audio:0},{filename:"/lib/python3.7/site-packages/py/_path/svnwc.py",start:34008,end:77833,audio:0},{filename:"/lib/python3.7/site-packages/py/_path/common.py",start:77833,end:92459,audio:0},{filename:"/lib/python3.7/site-packages/py/_path/cacheutil.py",start:92459,end:95792,audio:0},{filename:"/lib/python3.7/site-packages/py/_path/local.py",start:95792,end:132489,audio:0},{filename:"/lib/python3.7/site-packages/py/_path/svnurl.py",start:132489,end:147204,audio:0},{filename:"/lib/python3.7/site-packages/py/_code/_assertionold.py",start:147204,end:165073,audio:0},{filename:"/lib/python3.7/site-packages/py/_code/__init__.py",start:165073,end:165119,audio:0},{filename:"/lib/python3.7/site-packages/py/_code/_py2traceback.py",start:165119,end:167884,audio:0},{filename:"/lib/python3.7/site-packages/py/_code/code.py",start:167884,end:195376,audio:0},{filename:"/lib/python3.7/site-packages/py/_code/_assertionnew.py",start:195376,end:206826,audio:0},{filename:"/lib/python3.7/site-packages/py/_code/source.py",start:206826,end:220876,audio:0},{filename:"/lib/python3.7/site-packages/py/_code/assertion.py",start:220876,end:224050,audio:0},{filename:"/lib/python3.7/site-packages/py/_io/__init__.py",start:224050,end:224079,audio:0},{filename:"/lib/python3.7/site-packages/py/_io/capture.py",start:224079,end:235719,audio:0},{filename:"/lib/python3.7/site-packages/py/_io/terminalwriter.py",start:235719,end:250379,audio:0},{filename:"/lib/python3.7/site-packages/py/_io/saferepr.py",start:250379,end:252862,audio:0},{filename:"/lib/python3.7/site-packages/py/_process/cmdexec.py",start:252862,end:254676,audio:0},{filename:"/lib/python3.7/site-packages/py/_process/__init__.py",start:254676,end:254716,audio:0},{filename:"/lib/python3.7/site-packages/py/_process/forkedfunc.py",start:254716,end:258408,audio:0},{filename:"/lib/python3.7/site-packages/py/_process/killproc.py",start:258408,end:259056,audio:0},{filename:"/lib/python3.7/site-packages/py/_log/warning.py",start:259056,end:261621,audio:0},{filename:"/lib/python3.7/site-packages/py/_log/__init__.py",start:261621,end:261695,audio:0},{filename:"/lib/python3.7/site-packages/py/_log/log.py",start:261695,end:267698,audio:0},{filename:"/lib/python3.7/site-packages/py-1.8.0-py3.7.egg-info/SOURCES.txt",start:267698,end:271310,audio:0},{filename:"/lib/python3.7/site-packages/py-1.8.0-py3.7.egg-info/not-zip-safe",start:271310,end:271311,audio:0},{filename:"/lib/python3.7/site-packages/py-1.8.0-py3.7.egg-info/top_level.txt",start:271311,end:271314,audio:0},{filename:"/lib/python3.7/site-packages/py-1.8.0-py3.7.egg-info/dependency_links.txt",start:271314,end:271315,audio:0},{filename:"/lib/python3.7/site-packages/py-1.8.0-py3.7.egg-info/PKG-INFO",start:271315,end:274433,audio:0}],remote_package_size:157942,package_uuid:"bbb24fdd-0a7e-428e-9bf1-bac2536f9095"})})();