remotepy 1.0.0 → 1.0.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.
- package/README.md +24 -36
- package/build/remotepy.minobs.js +1 -1
- package/package.json +3 -6
package/README.md
CHANGED
|
@@ -4,52 +4,40 @@ Remote Py allows you to write python functions and run it on a server. It also p
|
|
|
4
4
|
|
|
5
5
|
It is a RPC mechanism built on top of Web Sockets allowing you to communicate both ways.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
##Requirements:
|
|
9
8
|
Please make sure you have a remotepy server that you are connecting to.
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
##Sample JavaScript client:
|
|
14
13
|
|
|
14
|
+
###Installation instructions:
|
|
15
15
|
```
|
|
16
16
|
npm install remotepy
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
####
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
#### index.html : Include following script tags on your web page
|
|
20
|
+
```html
|
|
21
|
+
<script language="JavaScript" src="js/remotepy.1.0.0.min.js"></script>
|
|
22
|
+
```
|
|
22
23
|
|
|
23
24
|
```html
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
alert(sum);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
client.onclose = function() {
|
|
46
|
-
divStatus.innerHTML = 'connection closed';
|
|
47
|
-
}
|
|
48
|
-
</script>
|
|
49
|
-
</head>
|
|
50
|
-
<body>
|
|
51
|
-
<div id="divStatus"/>
|
|
52
|
-
</body>
|
|
53
|
-
</html>
|
|
25
|
+
<script language="JavaScript">
|
|
26
|
+
var RemotePy = new RemotePyClient();
|
|
27
|
+
window.onload = function() {
|
|
28
|
+
RemotePy.serverName = 'ws://localhost:8082';
|
|
29
|
+
RemotePy.start();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
RemotePy.onopen = function() {
|
|
33
|
+
RemotePy.MyPythonServer.add(2,4, function(sum) {
|
|
34
|
+
alert(sum);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
RemotePy.onclose = function() {
|
|
39
|
+
divStatus.innerHTML = 'connection closed';
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
54
42
|
|
|
55
43
|
```
|
package/build/remotepy.minobs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a0_0x2522(){var _0x2ad975=['...func','apply','callMultipleCallbackPythonFunction','string','registerMultipleCallbackPythonFunction','callback','streaming','533346GkXvqd','PythonFunctionsArgs','log','403967dsrdvT','bind','Connection\x20not\x20open.','error','onopen','end','addPostOpenEventHandler','readAsArrayBuffer','pythonCallbackDict','Connection\x20to\x20','socket','getServerString','317193aAIkpX','PostOpenEventHandlers','map','readyState','getPythonFunctionLibraryHelp','substr','PythonFunctions','addPostMessageEventHandler','parse','length','JS2Py','getService','addPreOpenEventHandler','onmessage','callPythonFunction','sendImageBinary','connect','function','clientPageId','PreMessageEventHandlers','onmessageprocessed','getServerAPI','\x27].slice(0,\x20-1);\x0a','addPreCloseEventHandler','00\x20','shift','Connecting\x20to\x20:\x20','Too\x20many\x20callbacks\x20for\x20','onclose','Function\x20:\x20','20IZWMtH','isOpen','\x20...','PostMessageEventHandlers','pythonMultipleCallbackDict','buffer','forEach','sendBinary','registerCallbackToPythonFunction','104780aeXJAy','target','JS2PY_SESSION_ID','type','row','getItem','PreCloseEventHandlers','Message\x20received:\x20','start','indexOf','Connected\x20to\x20Server\x20:','1518232jcNvNZ','readCallbackArguments','stream_item','PythonFunctionsHelp','send','onmessagereceived','getElementById','src','binaryType','14GQCmcN','addPostCloseEventHandler','funcName','The\x20dropped\x20file\x20is\x20an\x20image:\x20','binaryFunctionQueue','toString','oninit','439004WROfWg','jsFunctionDict','407fErGKY','stream_index','match','callPythonFunctionBinary','Undefined','data','args','var\x20args\x20=\x20Array.prototype.slice.call(arguments);\x20var\x20inputObject\x20=\x20{};\x20for(var\x20i\x20in\x20paramNames)\x20{\x20var\x20paramName\x20=\x20paramNames[i];\x20if(paramName\x20!=\x20\x27...func\x27)\x20{\x20inputObject[paramName]\x20=\x20args[i];}\x20}\x20return\x20this.callMultipleCallbackPythonFunction(\x27','No\x20function\x20defined\x20for\x20','func','3356550luDDCF','readAsDataURL','blob','ws://localhost:8082','serverName','No\x20function\x20callback\x20defined\x20for\x20','PreOpenEventHandlers','result','getSessionId','stringify','isBinary','getPythonFunctionLibrary','2nDZwdS','callFunc','PostCloseEventHandlers','push','return','message(b)\x20received\x20:\x20','slice','addPreMessageEventHandler'];a0_0x2522=function(){return _0x2ad975;};return a0_0x2522();}(function(_0x1cef8b,_0x5c2584){var _0x6b29cc=a0_0x2448,_0x49ab84=_0x1cef8b();while(!![]){try{var _0x5ecb97=-parseInt(_0x6b29cc(0x101))/0x1*(parseInt(_0x6b29cc(0xef))/0x2)+-parseInt(_0x6b29cc(0x10d))/0x3+-parseInt(_0x6b29cc(0x14f))/0x4*(-parseInt(_0x6b29cc(0x12b))/0x5)+-parseInt(_0x6b29cc(0xfe))/0x6+parseInt(_0x6b29cc(0x148))/0x7*(parseInt(_0x6b29cc(0x13f))/0x8)+-parseInt(_0x6b29cc(0xe3))/0x9+parseInt(_0x6b29cc(0x134))/0xa*(parseInt(_0x6b29cc(0xd9))/0xb);if(_0x5ecb97===_0x5c2584)break;else _0x49ab84['push'](_0x49ab84['shift']());}catch(_0x27f9fc){_0x49ab84['push'](_0x49ab84['shift']());}}}(a0_0x2522,0x394d5));function a0_0x2448(_0x4b41e8,_0x551d14){var _0x252211=a0_0x2522();return a0_0x2448=function(_0x244856,_0x1d1c17){_0x244856=_0x244856-0xd8;var _0x51857d=_0x252211[_0x244856];return _0x51857d;},a0_0x2448(_0x4b41e8,_0x551d14);}function RemotePyClient(_0x1e200a,_0x37544f){var _0x462de0=a0_0x2448;if(_0x1e200a===undefined)this[_0x462de0(0xe7)]=_0x462de0(0xe6);else this['serverName']=_0x1e200a;if(_0x37544f===undefined)this['clientPageId']=_0x462de0(0xdd);else this[_0x462de0(0x11f)]=_0x37544f;this[_0x462de0(0x12c)]=![],this[_0x462de0(0xd8)]=[],this[_0x462de0(0x109)]=[],this[_0x462de0(0x14c)]=[],this[_0x462de0(0x113)]={},this[_0x462de0(0x10b)]=null,this[_0x462de0(0x142)]={},this[_0x462de0(0x12f)]={},this[_0x462de0(0xff)]={},this[_0x462de0(0x117)]={};let _0x3f4a0a=null;this[_0x462de0(0xe9)]=[],this[_0x462de0(0x13a)]=[],this['PreMessageEventHandlers']=[],this[_0x462de0(0x10e)]=[],this[_0x462de0(0xf1)]=[],this[_0x462de0(0x12e)]=[],this[_0x462de0(0x119)]=_0x37a07d=>this['PreOpenEventHandlers'][_0x462de0(0xf2)](_0x37a07d),this[_0x462de0(0x124)]=_0x2bc858=>this[_0x462de0(0x13a)][_0x462de0(0xf2)](_0x2bc858),this[_0x462de0(0xf6)]=_0x67d1fa=>this['PreMessageEventHandlers'][_0x462de0(0xf2)](_0x67d1fa),this[_0x462de0(0x107)]=_0x6a8987=>this[_0x462de0(0x10e)][_0x462de0(0xf2)](_0x6a8987),this[_0x462de0(0x149)]=_0x360d52=>this['PostCloseEventHandlers']['push'](_0x360d52),this[_0x462de0(0x114)]=_0xa48ced=>this[_0x462de0(0x12e)][_0x462de0(0xf2)](_0xa48ced),this['getServerString']=function(){var _0x4c46db=_0x462de0;return this[_0x4c46db(0xe7)]+'/'+this['clientPageId'];},this[_0x462de0(0x140)]=function(_0x2a5681,..._0x527fd1){var _0x4bcd11=_0x462de0;for(var _0x20be6d=_0x527fd1[_0x4bcd11(0x116)]-0x1;_0x20be6d>=0x0;--_0x20be6d){if(typeof _0x527fd1[_0x20be6d]!==_0x4bcd11(0x11e))break;}var _0xf7faf6=_0x527fd1[_0x4bcd11(0xf5)](0x0,_0x20be6d+0x1),_0x4d0953=_0x527fd1['slice'](_0x20be6d+0x1);return[_0x2a5681,_0xf7faf6,_0x4d0953];},this[_0x462de0(0xfb)]=function(_0x18b8b8,..._0x4ae553){var _0x3512b0=_0x462de0;this[_0x3512b0(0x12f)][_0x18b8b8]=_0x4ae553;},this['callMultipleCallbackPythonFunction']=function(_0x3fbff0,..._0x1982d1){var _0x2edc81=_0x462de0,_0x3eb7fb=this['readCallbackArguments'](_0x3fbff0,..._0x1982d1);_0x3fbff0=_0x3eb7fb[0x0];let _0x20521e=_0x3eb7fb[0x1][0x0],_0x4870b7=_0x3eb7fb[0x2];this[_0x2edc81(0x12c)]?(this[_0x2edc81(0x10b)][_0x2edc81(0x143)](JSON[_0x2edc81(0xec)]({'funcName':_0x3fbff0,'args':_0x20521e,'session_id':this[_0x2edc81(0xeb)]()})),console[_0x2edc81(0x100)](_0x2edc81(0x12a)+_0x3fbff0+'\x20called\x20with\x20arguments:\x20'+JSON[_0x2edc81(0xec)](_0x20521e))):console[_0x2edc81(0x100)](_0x2edc81(0x103)),_0x4870b7[_0x2edc81(0x116)]>0x0&&this[_0x2edc81(0xfb)](_0x3fbff0,..._0x4870b7);},this['registerCallbackToPythonFunction']=function(_0x317539,_0xb1e07a){var _0x52d21a=_0x462de0,_0x45fd43=this[_0x52d21a(0x109)][_0x52d21a(0x10f)](function(_0x9a4e1c){var _0x18cc67=_0x52d21a;return _0x9a4e1c[_0x18cc67(0x14a)];})[_0x52d21a(0x13d)](_0x317539);_0x45fd43<0x0?this[_0x52d21a(0x109)]['push']({'funcName':_0x317539,'callback':_0xb1e07a}):this['pythonCallbackDict'][_0x45fd43][_0x52d21a(0xfc)]=_0xb1e07a;},this['getSessionId']=function(){var _0x3230a4=_0x462de0;return sessionStorage[_0x3230a4(0x139)](_0x3230a4(0x136));},this['registerJSFunctionToBeCalledByPython']=function(_0x3af557,_0x5c629f){var _0x4f2ef0=_0x462de0;this[_0x4f2ef0(0xd8)][_0x4f2ef0(0xf2)]({'funcName':_0x3af557,'func':_0x5c629f});},this[_0x462de0(0xf0)]=function(_0x676b7b,_0x1dfd2f,_0x49ce58){var _0x1d359e=_0x462de0;this[_0x1d359e(0x12c)]?(this[_0x1d359e(0x10b)]['send'](JSON['stringify']({'funcName':_0x676b7b,'args':_0x1dfd2f,'session_id':this[_0x1d359e(0xeb)]()})),console['log'](_0x1d359e(0x12a)+_0x676b7b+'\x20called\x20with\x20arguments:\x20'+JSON[_0x1d359e(0xec)](_0x1dfd2f))):console[_0x1d359e(0x100)]('Connection\x20not\x20open.');if(_0x49ce58===undefined){}else this[_0x1d359e(0x133)](_0x676b7b,_0x49ce58);},this[_0x462de0(0x11b)]=function(_0x4da6dd,_0x3b6ac3,..._0x43b772){var _0x525408=_0x462de0;this[_0x525408(0xf9)](_0x4da6dd,_0x3b6ac3,..._0x43b772);},this[_0x462de0(0xdc)]=function(_0x394ba1,_0x4604c3,_0x38684d,_0x4dce2a){var _0x384c60=_0x462de0;_0x4604c3===undefined&&(_0x4604c3={});_0x4604c3[_0x384c60(0xed)]=!![],this['callFunc'](_0x394ba1,_0x4604c3);if(this['isOpen']){this[_0x384c60(0x132)](_0x38684d);if(_0x4dce2a===undefined){}else this[_0x384c60(0x133)](_0x394ba1,_0x4dce2a);}else console['log'](_0x384c60(0x103));},this['sendBinary']=function(_0x1e4393){var _0x237781=_0x462de0,_0x2ed529=new FileReader();_0x2ed529['onload']=function(_0x327938){var _0x2253ce=a0_0x2448,_0x3f7243=_0x327938[_0x2253ce(0x135)][_0x2253ce(0xea)];if(this[_0x2253ce(0x10b)]&&this['socket'][_0x2253ce(0x110)]==0x1)this['socket'][_0x2253ce(0x143)](_0x3f7243);},_0x2ed529[_0x237781(0x108)](_0x1e4393);},this['sendNonImageBinary']=function(_0x3a884c){var _0x1ced11=_0x462de0;if(_0x3a884c[_0x1ced11(0x137)][_0x1ced11(0xdb)](/image.*/)){console[_0x1ced11(0x100)](_0x1ced11(0x14b),_0x3a884c[_0x1ced11(0x137)]);return;}var _0x3e44f3=new FileReader();_0x3e44f3['onload']=function(_0xf653c0){var _0x1aec2a=_0x1ced11,_0x132502=_0xf653c0[_0x1aec2a(0x135)][_0x1aec2a(0xea)];if(this[_0x1aec2a(0x10b)]&&this[_0x1aec2a(0x10b)][_0x1aec2a(0x110)]==0x1)this[_0x1aec2a(0x10b)]['send'](_0x132502);},_0x3e44f3[_0x1ced11(0x108)](_0x3a884c);},this[_0x462de0(0x11c)]=function(_0x3aa2c7){var _0xca1ea6=_0x462de0;if(!_0x3aa2c7['type'][_0xca1ea6(0xdb)](/image.*/)){console['log']('The\x20dropped\x20file\x20is\x20not\x20an\x20image:\x20',_0x3aa2c7[_0xca1ea6(0x137)]);return;}var _0x515109=new FileReader();_0x515109['onload']=function(_0x3499ec){var _0x104bce=_0xca1ea6,_0x2aa2c0=_0x3499ec[_0x104bce(0x135)][_0x104bce(0xea)];if(this[_0x104bce(0x10b)]&&this[_0x104bce(0x10b)][_0x104bce(0x110)]==0x1)this[_0x104bce(0x10b)][_0x104bce(0x143)](_0x2aa2c0);},_0x515109[_0xca1ea6(0x108)](_0x3aa2c7);},this['createJSProxyFunctions']=function(_0x2dca3c){var _0x23bf1c=_0x462de0;for(var _0x22f4e6 in this[_0x23bf1c(0xff)]){var _0x45e2b4=this[_0x23bf1c(0xff)][_0x22f4e6];_0x45e2b4[_0x23bf1c(0xf2)](_0x23bf1c(0xf7));var _0x536190='var\x20paramNames\x20=\x20this.PythonFunctionsArgs[\x27'+_0x22f4e6+_0x23bf1c(0x123)+_0x23bf1c(0xe0)+_0x22f4e6+'\x27,\x20inputObject,\x20...func);';_0x45e2b4[_0x23bf1c(0xf2)](_0x536190),_0x3f4a0a=this;if(_0x22f4e6[_0x23bf1c(0x13d)]('.')>=0x0){var _0x4b08d7=_0x22f4e6['split']('.'),_0x309ae9=this[_0x23bf1c(0x113)];for(var _0x289434=0x0;_0x289434<_0x4b08d7['length']-0x1;_0x289434++){!(_0x4b08d7[_0x289434]in _0x309ae9)&&(_0x309ae9[_0x4b08d7[_0x289434]]={}),_0x309ae9=_0x309ae9[_0x4b08d7[_0x289434]];}_0x309ae9[_0x4b08d7[_0x4b08d7[_0x23bf1c(0x116)]-0x1]]=Function[_0x23bf1c(0xf8)](null,_0x45e2b4)[_0x23bf1c(0x102)](this);}else this[_0x23bf1c(0x113)][_0x22f4e6]=Function[_0x23bf1c(0xf8)](null,_0x45e2b4)[_0x23bf1c(0x102)](this);}},this[_0x462de0(0x11d)]=function(){var _0x4c5127=_0x462de0;this[_0x4c5127(0x14e)]!==undefined&&this['oninit']();var _0x2ab66d=this[_0x4c5127(0x10c)]();console[_0x4c5127(0x100)](_0x4c5127(0x127)+_0x2ab66d+_0x4c5127(0x12d)),this['socket']=new WebSocket(_0x2ab66d),this[_0x4c5127(0x10b)][_0x4c5127(0x147)]='arraybuffer',_0x3f4a0a=this,this['socket'][_0x4c5127(0x105)]=function(){var _0x5c9421=_0x4c5127;console[_0x5c9421(0x100)](_0x5c9421(0x13e)+_0x2ab66d),_0x3f4a0a['PreOpenEventHandlers'][_0x5c9421(0x131)](_0x22596d=>_0x22596d()),_0x3f4a0a[_0x5c9421(0x12c)]=!![],_0x3f4a0a[_0x5c9421(0x105)]!==undefined&&(_0x3f4a0a['callMultipleCallbackPythonFunction'](_0x5c9421(0xee),{},function(_0x15bba2){var _0x34a7ac=_0x5c9421;_0x3f4a0a[_0x34a7ac(0xff)]={};for(var _0x896fea in _0x15bba2){_0x15bba2[_0x896fea][_0x34a7ac(0x126)](),_0x15bba2[_0x896fea][0x0]=='session_id'&&_0x15bba2[_0x896fea][_0x34a7ac(0x126)](),_0x3f4a0a[_0x34a7ac(0xff)][_0x896fea]=_0x15bba2[_0x896fea];}_0x3f4a0a['createJSProxyFunctions'](''),_0x3f4a0a[_0x34a7ac(0x105)]();}),_0x3f4a0a['callMultipleCallbackPythonFunction'](_0x5c9421(0x111),{},function(_0x43e0ff){var _0x59c142=_0x5c9421;_0x3f4a0a[_0x59c142(0x142)]=_0x43e0ff;})),_0x3f4a0a['PostOpenEventHandlers'][_0x5c9421(0x131)](_0x3fe694=>_0x3fe694());},this[_0x4c5127(0x10b)][_0x4c5127(0x11a)]=function(_0x1347c3){var _0x4ffcb=_0x4c5127;_0x3f4a0a[_0x4ffcb(0x120)][_0x4ffcb(0x131)](_0x525ebc=>_0x525ebc());_0x3f4a0a[_0x4ffcb(0x144)]!==undefined&&_0x3f4a0a[_0x4ffcb(0x144)](_0x1347c3);if(typeof _0x1347c3[_0x4ffcb(0xde)]==_0x4ffcb(0xfa)){console[_0x4ffcb(0x100)](_0x4ffcb(0x13b)+_0x1347c3[_0x4ffcb(0xde)]);var _0x382950=JSON[_0x4ffcb(0x115)](_0x1347c3['data']);if(_0x4ffcb(0xdf)in _0x382950){var _0x4ca059=_0x3f4a0a[_0x4ffcb(0xd8)][_0x4ffcb(0x10f)](function(_0x543fd9){var _0x4c21df=_0x4ffcb;return _0x543fd9[_0x4c21df(0x14a)];})[_0x4ffcb(0x13d)](_0x382950[_0x4ffcb(0x14a)]);if(_0x4ca059>=0x0){var _0x1e6a89=_0x3f4a0a[_0x4ffcb(0xd8)][_0x4ca059];'isBinary'in _0x382950['args']?_0x3f4a0a[_0x4ffcb(0x14c)][_0x4ffcb(0xf2)]({'funcName':_0x382950[_0x4ffcb(0x14a)],'callback':_0x1e6a89[_0x4ffcb(0xe2)],'args':_0x382950[_0x4ffcb(0xdf)]}):_0x1e6a89[_0x4ffcb(0xe2)](_0x382950[_0x4ffcb(0xdf)]);}else{if(_0x382950[_0x4ffcb(0x14a)]==='getPythonFunctionLibrary')return;else throw _0x4ffcb(0xe1)+_0x382950['funcName'];}}else{if(_0x4ffcb(0xfd)in _0x382950){if(_0x382950[_0x4ffcb(0x14a)]in _0x3f4a0a[_0x4ffcb(0x12f)]){var _0x19a70d=_0x3f4a0a[_0x4ffcb(0x12f)][_0x382950[_0x4ffcb(0x14a)]];switch(_0x19a70d[_0x4ffcb(0x116)]){case 0x0:break;case 0x1:if(_0x4ffcb(0x104)in _0x382950)_0x19a70d[0x0](_0x382950[_0x4ffcb(0x104)],![]);if(_0x4ffcb(0xf3)in _0x382950)_0x19a70d[0x0](_0x382950['streaming'],_0x382950[_0x4ffcb(0xf3)],![]);break;case 0x2:if(_0x4ffcb(0x104)in _0x382950)_0x19a70d[0x0](_0x382950['error'],![]);if('return'in _0x382950)_0x19a70d[0x0](_0x382950[_0x4ffcb(0xfd)],_0x382950['return'],![]);if(_0x382950[_0x4ffcb(0xfd)]==_0x4ffcb(0x138))_0x19a70d[0x1](_0x382950[_0x4ffcb(0xda)],_0x382950['stream_item'],![]);break;case 0x3:if(_0x4ffcb(0x104)in _0x382950)_0x19a70d[0x0](_0x382950[_0x4ffcb(0x104)],![]);if(_0x382950[_0x4ffcb(0xfd)]==_0x4ffcb(0x13c))_0x19a70d[0x0](_0x382950[_0x4ffcb(0xf3)],![]);if(_0x382950[_0x4ffcb(0xfd)]==_0x4ffcb(0x138))_0x19a70d[0x1](_0x382950[_0x4ffcb(0xda)],_0x382950[_0x4ffcb(0x141)],![]);if(_0x382950[_0x4ffcb(0xfd)]==_0x4ffcb(0x106))_0x19a70d[0x2](_0x382950['stream_empty'],![]);break;case 0x4:if('error'in _0x382950)_0x19a70d[0x4](_0x382950[_0x4ffcb(0x104)],![]);if(_0x382950[_0x4ffcb(0xfd)]==_0x4ffcb(0x13c))_0x19a70d[0x0](_0x382950['return'],![]);if(_0x382950['streaming']==_0x4ffcb(0x138))_0x19a70d[0x1](_0x382950[_0x4ffcb(0xda)],_0x382950[_0x4ffcb(0x141)],![]);if(_0x382950[_0x4ffcb(0xfd)]=='end')_0x19a70d[0x2](_0x382950['stream_empty'],![]);break;default:throw _0x4ffcb(0x128)+_0x382950[_0x4ffcb(0x14a)];}}else throw _0x4ffcb(0xe8)+_0x382950[_0x4ffcb(0x14a)];}else{if(_0x382950[_0x4ffcb(0x14a)]in _0x3f4a0a[_0x4ffcb(0x12f)]){var _0x19a70d=_0x3f4a0a[_0x4ffcb(0x12f)][_0x382950[_0x4ffcb(0x14a)]];switch(_0x19a70d['length']){case 0x0:break;case 0x1:if(_0x4ffcb(0x104)in _0x382950)_0x19a70d[0x0](_0x382950[_0x4ffcb(0x104)],![]);if(_0x4ffcb(0xf3)in _0x382950)_0x19a70d[0x0](_0x382950[_0x4ffcb(0xf3)],![]);break;case 0x2:if(_0x4ffcb(0x104)in _0x382950)_0x19a70d[0x1](_0x382950[_0x4ffcb(0x104)],![]);if(_0x4ffcb(0xf3)in _0x382950)_0x19a70d[0x0](_0x382950[_0x4ffcb(0xf3)],![]);break;case 0x3:if('error'in _0x382950)_0x19a70d[0x0](_0x382950['error'],![]);if(_0x4ffcb(0xf3)in _0x382950)_0x19a70d[0x0](_0x382950[_0x4ffcb(0xf3)],![]);break;default:throw'Too\x20many\x20callbacks\x20for\x20'+_0x382950[_0x4ffcb(0x14a)];}}else{var _0x4ca059=_0x3f4a0a[_0x4ffcb(0x109)][_0x4ffcb(0x10f)](function(_0x347479){var _0x197e26=_0x4ffcb;return _0x347479[_0x197e26(0x14a)];})[_0x4ffcb(0x13d)](_0x382950[_0x4ffcb(0x14a)]);if(_0x4ca059>=0x0){var _0x1e6a89=_0x3f4a0a['pythonCallbackDict'][_0x4ca059];_0x382950[_0x4ffcb(0xf3)]===undefined?_0x382950[_0x4ffcb(0x104)]!==undefined&&_0x1e6a89[_0x4ffcb(0xfc)](_0x382950[_0x4ffcb(0x104)],![]):_0x1e6a89[_0x4ffcb(0xfc)](_0x382950[_0x4ffcb(0xf3)],!![]);}else throw _0x4ffcb(0xe1)+_0x382950[_0x4ffcb(0x14a)];}}}}else{var _0x249a6b=new Uint8Array(_0x1347c3[_0x4ffcb(0xde)]),_0x1740d3='\x20';for(var _0x5b478b=0x0;_0x5b478b<_0x249a6b[_0x4ffcb(0x116)];_0x5b478b++){_0x1740d3+=(_0x4ffcb(0x125)+_0x249a6b[_0x5b478b][_0x4ffcb(0x14d)](0x10))[_0x4ffcb(0x112)](-0x2);}var _0xdd83fd=_0x1347c3[_0x4ffcb(0xde)],_0x5e85cc=new Uint8Array(_0xdd83fd),_0x5c7594=new Blob([_0x5e85cc[_0x4ffcb(0x130)]]);if(_0x3f4a0a[_0x4ffcb(0x14c)][_0x4ffcb(0x116)]>0x0){var _0x205519=_0x3f4a0a[_0x4ffcb(0x14c)][_0x4ffcb(0x126)]();_0x205519[_0x4ffcb(0xdf)][_0x4ffcb(0xe5)]=_0x5c7594,_0x205519['callback'](_0x205519['args']);}else{var _0x43a0c5=new FileReader();_0x43a0c5['onload']=function(_0x88ed4e){var _0x46c1b5=_0x4ffcb;imgFig[_0x46c1b5(0x146)]=_0x88ed4e[_0x46c1b5(0x135)][_0x46c1b5(0xea)];},_0x43a0c5[_0x4ffcb(0xe4)](_0x5c7594),document[_0x4ffcb(0x145)]('StatusBar')['innerHTML']='Chart\x20Loading\x20Completed\x20...';}console[_0x4ffcb(0x100)](_0x4ffcb(0xf4)+_0x1740d3);}_0x3f4a0a['onmessageprocessed']!==undefined&&_0x3f4a0a[_0x4ffcb(0x121)](),_0x3f4a0a[_0x4ffcb(0x12e)][_0x4ffcb(0x131)](_0x493b75=>_0x493b75());},this['socket']['onclose']=function(_0x53149d){var _0x270a6f=_0x4c5127;console[_0x270a6f(0x100)](_0x270a6f(0x10a)+_0x2ab66d+'\x20closed.'),_0x3f4a0a[_0x270a6f(0x13a)][_0x270a6f(0x131)](_0x2f2490=>_0x2f2490()),_0x3f4a0a[_0x270a6f(0x12c)]=![],socket=null,_0x3f4a0a[_0x270a6f(0x129)]!==undefined&&_0x3f4a0a[_0x270a6f(0x129)](),_0x3f4a0a[_0x270a6f(0xf1)][_0x270a6f(0x131)](_0x1abb82=>_0x1abb82());};},this[_0x462de0(0x122)]=function(){var _0x2fc408=_0x462de0;return this[_0x2fc408(0x113)];},this[_0x462de0(0x118)]=function(_0x13e8c0){var _0x19b18e=_0x462de0;return this[_0x19b18e(0x113)][_0x13e8c0];};}export{RemotePyClient};
|
|
1
|
+
function a0_0x136b(_0x5efff9,_0x457501){var _0x2316bf=a0_0x2316();return a0_0x136b=function(_0x136bb3,_0x9f51c3){_0x136bb3=_0x136bb3-0xe6;var _0x2014aa=_0x2316bf[_0x136bb3];return _0x2014aa;},a0_0x136b(_0x5efff9,_0x457501);}(function(_0x53e2f3,_0x2245dd){var _0x395d9d=a0_0x136b,_0x44a62c=_0x53e2f3();while(!![]){try{var _0x1c8150=parseInt(_0x395d9d(0x14e))/0x1*(parseInt(_0x395d9d(0x114))/0x2)+parseInt(_0x395d9d(0x10e))/0x3*(-parseInt(_0x395d9d(0xe6))/0x4)+-parseInt(_0x395d9d(0x156))/0x5*(-parseInt(_0x395d9d(0x15a))/0x6)+-parseInt(_0x395d9d(0xec))/0x7+parseInt(_0x395d9d(0x122))/0x8+parseInt(_0x395d9d(0x13e))/0x9+parseInt(_0x395d9d(0x148))/0xa*(parseInt(_0x395d9d(0xef))/0xb);if(_0x1c8150===_0x2245dd)break;else _0x44a62c['push'](_0x44a62c['shift']());}catch(_0x3f13a2){_0x44a62c['push'](_0x44a62c['shift']());}}}(a0_0x2316,0xd0ef8));function JS2PyClient(_0x37e614,_0x30e6c7){var _0x515b01=a0_0x136b;if(_0x37e614===undefined)this[_0x515b01(0xf9)]=_0x515b01(0xfc);else this['serverName']=_0x37e614;if(_0x30e6c7===undefined)this[_0x515b01(0x12d)]=_0x515b01(0xf0);else this[_0x515b01(0x12d)]=_0x30e6c7;this[_0x515b01(0x134)]=![],this['jsFunctionDict']=[],this['pythonCallbackDict']=[],this[_0x515b01(0xf1)]=[],this[_0x515b01(0xed)]={},this['socket']=null,this['PythonFunctionsHelp']={},this[_0x515b01(0x153)]={},this[_0x515b01(0xfe)]={},this[_0x515b01(0xfd)]={};let _0xea818a=null;this['PreOpenEventHandlers']=[],this[_0x515b01(0x144)]=[],this['PreMessageEventHandlers']=[],this[_0x515b01(0x10d)]=[],this[_0x515b01(0x116)]=[],this['PostMessageEventHandlers']=[],this[_0x515b01(0x102)]=_0x30495f=>this['PreOpenEventHandlers']['push'](_0x30495f),this[_0x515b01(0x13b)]=_0x2a64fd=>this[_0x515b01(0x144)][_0x515b01(0x14b)](_0x2a64fd),this[_0x515b01(0x13f)]=_0xc06aa0=>this[_0x515b01(0x11a)][_0x515b01(0x14b)](_0xc06aa0),this[_0x515b01(0xff)]=_0x1b46c6=>this[_0x515b01(0x10d)][_0x515b01(0x14b)](_0x1b46c6),this[_0x515b01(0x109)]=_0x300228=>this[_0x515b01(0x116)][_0x515b01(0x14b)](_0x300228),this['addPostMessageEventHandler']=_0x3b8c69=>this[_0x515b01(0x136)][_0x515b01(0x14b)](_0x3b8c69),this[_0x515b01(0x14a)]=function(){var _0x1d880c=_0x515b01;return this['serverName']+'/'+this[_0x1d880c(0x12d)];},this['readCallbackArguments']=function(_0x3d2619,..._0x3b7195){var _0x537af5=_0x515b01;for(var _0x37bcab=_0x3b7195['length']-0x1;_0x37bcab>=0x0;--_0x37bcab){if(typeof _0x3b7195[_0x37bcab]!=='function')break;}var _0x37baae=_0x3b7195['slice'](0x0,_0x37bcab+0x1),_0x56e4fe=_0x3b7195[_0x537af5(0x119)](_0x37bcab+0x1);return[_0x3d2619,_0x37baae,_0x56e4fe];},this[_0x515b01(0xfa)]=function(_0x3b148e,..._0x4a2fa6){var _0x3b13c8=_0x515b01;this[_0x3b13c8(0x153)][_0x3b148e]=_0x4a2fa6;},this[_0x515b01(0x100)]=function(_0x34548e,..._0x2d5e03){var _0xe664e5=_0x515b01,_0x5dcf78=this[_0xe664e5(0x127)](_0x34548e,..._0x2d5e03);_0x34548e=_0x5dcf78[0x0];let _0x5ea0b9=_0x5dcf78[0x1][0x0],_0x5c2b96=_0x5dcf78[0x2];this[_0xe664e5(0x134)]?(this[_0xe664e5(0x14c)]['send'](JSON['stringify']({'funcName':_0x34548e,'args':_0x5ea0b9,'session_id':this[_0xe664e5(0x130)]()})),console[_0xe664e5(0x12c)](_0xe664e5(0x103)+_0x34548e+_0xe664e5(0x131)+JSON['stringify'](_0x5ea0b9))):console[_0xe664e5(0x12c)](_0xe664e5(0x142)),_0x5c2b96['length']>0x0&&this[_0xe664e5(0xfa)](_0x34548e,..._0x5c2b96);},this[_0x515b01(0x107)]=function(_0xa535b3,_0x312ccc){var _0x54c376=_0x515b01,_0x17898c=this[_0x54c376(0x117)][_0x54c376(0x157)](function(_0x8dd179){var _0x1bc6b3=_0x54c376;return _0x8dd179[_0x1bc6b3(0x14d)];})[_0x54c376(0x11e)](_0xa535b3);_0x17898c<0x0?this[_0x54c376(0x117)][_0x54c376(0x14b)]({'funcName':_0xa535b3,'callback':_0x312ccc}):this[_0x54c376(0x117)][_0x17898c][_0x54c376(0x126)]=_0x312ccc;},this[_0x515b01(0x130)]=function(){var _0x114077=_0x515b01;return sessionStorage[_0x114077(0x10a)](_0x114077(0x12f));},this['registerJSFunctionToBeCalledByPython']=function(_0x1167bd,_0x232f1e){var _0x441747=_0x515b01;this[_0x441747(0xf2)][_0x441747(0x14b)]({'funcName':_0x1167bd,'func':_0x232f1e});},this['callFunc']=function(_0xa1ae91,_0x4a2338,_0x1287bb){var _0x4fb2a1=_0x515b01;this[_0x4fb2a1(0x134)]?(this[_0x4fb2a1(0x14c)]['send'](JSON[_0x4fb2a1(0xf4)]({'funcName':_0xa1ae91,'args':_0x4a2338,'session_id':this[_0x4fb2a1(0x130)]()})),console[_0x4fb2a1(0x12c)](_0x4fb2a1(0x103)+_0xa1ae91+'\x20called\x20with\x20arguments:\x20'+JSON['stringify'](_0x4a2338))):console[_0x4fb2a1(0x12c)]('Connection\x20not\x20open.');if(_0x1287bb===undefined){}else this['registerCallbackToPythonFunction'](_0xa1ae91,_0x1287bb);},this['callPythonFunction']=function(_0x1ee93a,_0x119c2b,..._0x2666d4){var _0xbf2e00=_0x515b01;this[_0xbf2e00(0x100)](_0x1ee93a,_0x119c2b,..._0x2666d4);},this[_0x515b01(0x113)]=function(_0x5b5578,_0xe56be0,_0x33a1ca,_0xe46f2f){var _0x55c6e5=_0x515b01;_0xe56be0===undefined&&(_0xe56be0={});_0xe56be0[_0x55c6e5(0x151)]=!![],this['callFunc'](_0x5b5578,_0xe56be0);if(this[_0x55c6e5(0x134)]){this[_0x55c6e5(0xf3)](_0x33a1ca);if(_0xe46f2f===undefined){}else this['registerCallbackToPythonFunction'](_0x5b5578,_0xe46f2f);}else console[_0x55c6e5(0x12c)](_0x55c6e5(0x142));},this[_0x515b01(0xf3)]=function(_0xd92a99){var _0x2571c5=_0x515b01,_0x5b37bb=new FileReader();_0x5b37bb[_0x2571c5(0xea)]=function(_0x10eab0){var _0x1b801e=_0x2571c5,_0xd32610=_0x10eab0[_0x1b801e(0x13c)][_0x1b801e(0x11d)];if(this[_0x1b801e(0x14c)]&&this['socket'][_0x1b801e(0x14f)]==0x1)this['socket'][_0x1b801e(0x106)](_0xd32610);},_0x5b37bb[_0x2571c5(0x139)](_0xd92a99);},this[_0x515b01(0x12a)]=function(_0xf18a6f){var _0x2c5b09=_0x515b01;if(_0xf18a6f['type'][_0x2c5b09(0x129)](/image.*/)){console[_0x2c5b09(0x12c)]('The\x20dropped\x20file\x20is\x20an\x20image:\x20',_0xf18a6f[_0x2c5b09(0x112)]);return;}var _0x3d0726=new FileReader();_0x3d0726['onload']=function(_0x1acbab){var _0x5cc116=_0x2c5b09,_0x210f4e=_0x1acbab[_0x5cc116(0x13c)]['result'];if(this[_0x5cc116(0x14c)]&&this[_0x5cc116(0x14c)][_0x5cc116(0x14f)]==0x1)this['socket'][_0x5cc116(0x106)](_0x210f4e);},_0x3d0726[_0x2c5b09(0x139)](_0xf18a6f);},this['sendImageBinary']=function(_0xe96f14){var _0x51f53d=_0x515b01;if(!_0xe96f14['type']['match'](/image.*/)){console[_0x51f53d(0x12c)](_0x51f53d(0x10f),_0xe96f14[_0x51f53d(0x112)]);return;}var _0x33974a=new FileReader();_0x33974a[_0x51f53d(0xea)]=function(_0x2a50c8){var _0x2e72b8=_0x51f53d,_0x416390=_0x2a50c8['target'][_0x2e72b8(0x11d)];if(this[_0x2e72b8(0x14c)]&&this['socket'][_0x2e72b8(0x14f)]==0x1)this[_0x2e72b8(0x14c)]['send'](_0x416390);},_0x33974a[_0x51f53d(0x139)](_0xe96f14);},this[_0x515b01(0x133)]=function(_0x40a7d9){var _0x44330d=_0x515b01;for(var _0x39691f in this[_0x44330d(0xfe)]){var _0x11735a=this[_0x44330d(0xfe)][_0x39691f];_0x11735a[_0x44330d(0x14b)](_0x44330d(0x143));var _0x56a6bf=_0x44330d(0x101)+_0x39691f+_0x44330d(0x115)+_0x44330d(0x118)+_0x39691f+_0x44330d(0x155);_0x11735a['push'](_0x56a6bf),_0xea818a=this;if(_0x39691f[_0x44330d(0x11e)]('.')>=0x0){var _0x46da61=_0x39691f['split']('.'),_0x3b61d0=this[_0x44330d(0xed)];for(var _0x57c60c=0x0;_0x57c60c<_0x46da61[_0x44330d(0x105)]-0x1;_0x57c60c++){!(_0x46da61[_0x57c60c]in _0x3b61d0)&&(_0x3b61d0[_0x46da61[_0x57c60c]]={}),_0x3b61d0=_0x3b61d0[_0x46da61[_0x57c60c]];}_0x3b61d0[_0x46da61[_0x46da61[_0x44330d(0x105)]-0x1]]=Function['apply'](null,_0x11735a)['bind'](this);}else this[_0x44330d(0xed)][_0x39691f]=Function[_0x44330d(0x13d)](null,_0x11735a)[_0x44330d(0xe9)](this);}},this['start']=function(){var _0x4b7aa6=_0x515b01;this[_0x4b7aa6(0x140)]!==undefined&&this[_0x4b7aa6(0x140)]();var _0x2fb020=this[_0x4b7aa6(0x14a)]();console[_0x4b7aa6(0x12c)](_0x4b7aa6(0x150)+_0x2fb020+_0x4b7aa6(0x138)),this[_0x4b7aa6(0x14c)]=new WebSocket(_0x2fb020),this[_0x4b7aa6(0x14c)]['binaryType']='arraybuffer',_0xea818a=this,this[_0x4b7aa6(0x14c)][_0x4b7aa6(0x128)]=function(){var _0x32e17a=_0x4b7aa6;console['log']('Connected\x20to\x20Server\x20:'+_0x2fb020),_0xea818a[_0x32e17a(0x104)][_0x32e17a(0x108)](_0x50d2af=>_0x50d2af()),_0xea818a[_0x32e17a(0x134)]=!![],_0xea818a['onopen']!==undefined&&(_0xea818a[_0x32e17a(0x100)]('getPythonFunctionLibrary',{},function(_0x109541){var _0x252cc3=_0x32e17a;_0xea818a[_0x252cc3(0xfe)]={};for(var _0x4520bc in _0x109541){_0x109541[_0x4520bc]['shift'](),_0x109541[_0x4520bc][0x0]==_0x252cc3(0x125)&&_0x109541[_0x4520bc][_0x252cc3(0x158)](),_0xea818a[_0x252cc3(0xfe)][_0x4520bc]=_0x109541[_0x4520bc];}_0xea818a[_0x252cc3(0x133)](''),_0xea818a[_0x252cc3(0x128)]();}),_0xea818a[_0x32e17a(0x100)](_0x32e17a(0x149),{},function(_0x200c57){var _0x41cfec=_0x32e17a;_0xea818a[_0x41cfec(0xe8)]=_0x200c57;})),_0xea818a[_0x32e17a(0x10d)][_0x32e17a(0x108)](_0x246487=>_0x246487());},this[_0x4b7aa6(0x14c)]['onmessage']=function(_0x565968){var _0x1cac3f=_0x4b7aa6;_0xea818a[_0x1cac3f(0x11a)]['forEach'](_0x67a133=>_0x67a133());_0xea818a[_0x1cac3f(0x137)]!==undefined&&_0xea818a['onmessagereceived'](_0x565968);if(typeof _0x565968['data']==_0x1cac3f(0x135)){console['log'](_0x1cac3f(0x10b)+_0x565968[_0x1cac3f(0x132)]);var _0x2a8e73=JSON[_0x1cac3f(0xe7)](_0x565968['data']);if('args'in _0x2a8e73){var _0x4a0d97=_0xea818a[_0x1cac3f(0xf2)][_0x1cac3f(0x157)](function(_0x32c255){var _0x52ed9c=_0x1cac3f;return _0x32c255[_0x52ed9c(0x14d)];})['indexOf'](_0x2a8e73[_0x1cac3f(0x14d)]);if(_0x4a0d97>=0x0){var _0x1ca32b=_0xea818a['jsFunctionDict'][_0x4a0d97];_0x1cac3f(0x151)in _0x2a8e73[_0x1cac3f(0x146)]?_0xea818a[_0x1cac3f(0xf1)][_0x1cac3f(0x14b)]({'funcName':_0x2a8e73['funcName'],'callback':_0x1ca32b['func'],'args':_0x2a8e73[_0x1cac3f(0x146)]}):_0x1ca32b[_0x1cac3f(0xfb)](_0x2a8e73[_0x1cac3f(0x146)]);}else{if(_0x2a8e73[_0x1cac3f(0x14d)]===_0x1cac3f(0xf7))return;else throw _0x1cac3f(0x12b)+_0x2a8e73[_0x1cac3f(0x14d)];}}else{if(_0x1cac3f(0x141)in _0x2a8e73){if(_0x2a8e73[_0x1cac3f(0x14d)]in _0xea818a[_0x1cac3f(0x153)]){var _0x370e94=_0xea818a[_0x1cac3f(0x153)][_0x2a8e73[_0x1cac3f(0x14d)]];switch(_0x370e94[_0x1cac3f(0x105)]){case 0x0:break;case 0x1:if('error'in _0x2a8e73)_0x370e94[0x0](_0x2a8e73[_0x1cac3f(0x147)],![]);if(_0x1cac3f(0x124)in _0x2a8e73)_0x370e94[0x0](_0x2a8e73[_0x1cac3f(0x141)],_0x2a8e73['return'],![]);break;case 0x2:if(_0x1cac3f(0x147)in _0x2a8e73)_0x370e94[0x0](_0x2a8e73['error'],![]);if('return'in _0x2a8e73)_0x370e94[0x0](_0x2a8e73[_0x1cac3f(0x141)],_0x2a8e73['return'],![]);if(_0x2a8e73[_0x1cac3f(0x141)]==_0x1cac3f(0x111))_0x370e94[0x1](_0x2a8e73[_0x1cac3f(0x11b)],_0x2a8e73['stream_item'],![]);break;case 0x3:if(_0x1cac3f(0x147)in _0x2a8e73)_0x370e94[0x0](_0x2a8e73[_0x1cac3f(0x147)],![]);if(_0x2a8e73['streaming']=='start')_0x370e94[0x0](_0x2a8e73[_0x1cac3f(0x124)],![]);if(_0x2a8e73['streaming']==_0x1cac3f(0x111))_0x370e94[0x1](_0x2a8e73[_0x1cac3f(0x11b)],_0x2a8e73[_0x1cac3f(0x110)],![]);if(_0x2a8e73[_0x1cac3f(0x141)]==_0x1cac3f(0xeb))_0x370e94[0x2](_0x2a8e73['stream_empty'],![]);break;case 0x4:if('error'in _0x2a8e73)_0x370e94[0x4](_0x2a8e73[_0x1cac3f(0x147)],![]);if(_0x2a8e73[_0x1cac3f(0x141)]==_0x1cac3f(0x13a))_0x370e94[0x0](_0x2a8e73[_0x1cac3f(0x124)],![]);if(_0x2a8e73[_0x1cac3f(0x141)]=='row')_0x370e94[0x1](_0x2a8e73[_0x1cac3f(0x11b)],_0x2a8e73[_0x1cac3f(0x110)],![]);if(_0x2a8e73['streaming']==_0x1cac3f(0xeb))_0x370e94[0x2](_0x2a8e73[_0x1cac3f(0x154)],![]);break;default:throw _0x1cac3f(0x159)+_0x2a8e73['funcName'];}}else throw'No\x20function\x20callback\x20defined\x20for\x20'+_0x2a8e73[_0x1cac3f(0x14d)];}else{if(_0x2a8e73['funcName']in _0xea818a['pythonMultipleCallbackDict']){var _0x370e94=_0xea818a[_0x1cac3f(0x153)][_0x2a8e73[_0x1cac3f(0x14d)]];switch(_0x370e94[_0x1cac3f(0x105)]){case 0x0:break;case 0x1:if(_0x1cac3f(0x147)in _0x2a8e73)_0x370e94[0x0](_0x2a8e73[_0x1cac3f(0x147)],![]);if(_0x1cac3f(0x124)in _0x2a8e73)_0x370e94[0x0](_0x2a8e73[_0x1cac3f(0x124)],![]);break;case 0x2:if(_0x1cac3f(0x147)in _0x2a8e73)_0x370e94[0x1](_0x2a8e73['error'],![]);if('return'in _0x2a8e73)_0x370e94[0x0](_0x2a8e73['return'],![]);break;case 0x3:if(_0x1cac3f(0x147)in _0x2a8e73)_0x370e94[0x0](_0x2a8e73[_0x1cac3f(0x147)],![]);if(_0x1cac3f(0x124)in _0x2a8e73)_0x370e94[0x0](_0x2a8e73[_0x1cac3f(0x124)],![]);break;default:throw _0x1cac3f(0x159)+_0x2a8e73[_0x1cac3f(0x14d)];}}else{var _0x4a0d97=_0xea818a['pythonCallbackDict']['map'](function(_0x296a13){var _0x53795e=_0x1cac3f;return _0x296a13[_0x53795e(0x14d)];})['indexOf'](_0x2a8e73[_0x1cac3f(0x14d)]);if(_0x4a0d97>=0x0){var _0x1ca32b=_0xea818a['pythonCallbackDict'][_0x4a0d97];_0x2a8e73[_0x1cac3f(0x124)]===undefined?_0x2a8e73[_0x1cac3f(0x147)]!==undefined&&_0x1ca32b[_0x1cac3f(0x126)](_0x2a8e73[_0x1cac3f(0x147)],![]):_0x1ca32b[_0x1cac3f(0x126)](_0x2a8e73['return'],!![]);}else throw _0x1cac3f(0x12b)+_0x2a8e73[_0x1cac3f(0x14d)];}}}}else{var _0x2ef382=new Uint8Array(_0x565968['data']),_0x59e2c9='\x20';for(var _0x506321=0x0;_0x506321<_0x2ef382['length'];_0x506321++){_0x59e2c9+=(_0x1cac3f(0xf6)+_0x2ef382[_0x506321][_0x1cac3f(0x123)](0x10))[_0x1cac3f(0xee)](-0x2);}var _0x4de6b8=_0x565968[_0x1cac3f(0x132)],_0x3717da=new Uint8Array(_0x4de6b8),_0x5de157=new Blob([_0x3717da['buffer']]);if(_0xea818a['binaryFunctionQueue'][_0x1cac3f(0x105)]>0x0){var _0xf88365=_0xea818a[_0x1cac3f(0xf1)][_0x1cac3f(0x158)]();_0xf88365['args'][_0x1cac3f(0x11c)]=_0x5de157,_0xf88365['callback'](_0xf88365[_0x1cac3f(0x146)]);}else{var _0x165bcf=new FileReader();_0x165bcf[_0x1cac3f(0xea)]=function(_0x142963){var _0x210143=_0x1cac3f;imgFig['src']=_0x142963[_0x210143(0x13c)][_0x210143(0x11d)];},_0x165bcf[_0x1cac3f(0x121)](_0x5de157),document[_0x1cac3f(0x120)]('StatusBar')[_0x1cac3f(0xf8)]=_0x1cac3f(0x145);}console[_0x1cac3f(0x12c)]('message(b)\x20received\x20:\x20'+_0x59e2c9);}_0xea818a[_0x1cac3f(0xf5)]!==undefined&&_0xea818a[_0x1cac3f(0xf5)](),_0xea818a[_0x1cac3f(0x136)]['forEach'](_0x5b82d4=>_0x5b82d4());},this[_0x4b7aa6(0x14c)]['onclose']=function(_0x3bf8f5){var _0x223c36=_0x4b7aa6;console['log'](_0x223c36(0x152)+_0x2fb020+_0x223c36(0x10c)),_0xea818a[_0x223c36(0x144)][_0x223c36(0x108)](_0x38e081=>_0x38e081()),_0xea818a[_0x223c36(0x134)]=![],socket=null,_0xea818a[_0x223c36(0x12e)]!==undefined&&_0xea818a[_0x223c36(0x12e)](),_0xea818a['PostCloseEventHandlers'][_0x223c36(0x108)](_0x16a832=>_0x16a832());};},this[_0x515b01(0x11f)]=function(){var _0x6719dd=_0x515b01;return this[_0x6719dd(0xed)];};}export{JS2PyClient as RemotePy};function a0_0x2316(){var _0x4fd29b=['func','ws://localhost:8082','JS2Py','PythonFunctionsArgs','addPostOpenEventHandler','callMultipleCallbackPythonFunction','var\x20paramNames\x20=\x20this.PythonFunctionsArgs[\x27','addPreOpenEventHandler','Function\x20:\x20','PreOpenEventHandlers','length','send','registerCallbackToPythonFunction','forEach','addPostCloseEventHandler','getItem','Message\x20received:\x20','\x20closed.','PostOpenEventHandlers','123xUHwNu','The\x20dropped\x20file\x20is\x20not\x20an\x20image:\x20','stream_item','row','type','callPythonFunctionBinary','134294Yboehm','\x27].slice(0,\x20-1);\x0a','PostCloseEventHandlers','pythonCallbackDict','var\x20args\x20=\x20Array.prototype.slice.call(arguments);\x20var\x20inputObject\x20=\x20{};\x20for(var\x20i\x20in\x20paramNames)\x20{\x20var\x20paramName\x20=\x20paramNames[i];\x20if(paramName\x20!=\x20\x27...func\x27)\x20{\x20inputObject[paramName]\x20=\x20args[i];}\x20}\x20return\x20this.callMultipleCallbackPythonFunction(\x27','slice','PreMessageEventHandlers','stream_index','blob','result','indexOf','getRemotePyClient','getElementById','readAsDataURL','4527536GtQtLi','toString','return','session_id','callback','readCallbackArguments','onopen','match','sendNonImageBinary','No\x20function\x20defined\x20for\x20','log','clientPageId','onclose','JS2PY_SESSION_ID','getSessionId','\x20called\x20with\x20arguments:\x20','data','createJSProxyFunctions','isOpen','string','PostMessageEventHandlers','onmessagereceived','\x20...','readAsArrayBuffer','start','addPreCloseEventHandler','target','apply','2661597WiEdSK','addPreMessageEventHandler','oninit','streaming','Connection\x20not\x20open.','...func','PreCloseEventHandlers','Chart\x20Loading\x20Completed\x20...','args','error','5485330DytEJf','getPythonFunctionLibraryHelp','getServerString','push','socket','funcName','14VgffoG','readyState','Connecting\x20to\x20:\x20','isBinary','Connection\x20to\x20','pythonMultipleCallbackDict','stream_empty','\x27,\x20inputObject,\x20...func);','1193695cniFre','map','shift','Too\x20many\x20callbacks\x20for\x20','12LSkChy','91768jZyLgc','parse','PythonFunctionsHelp','bind','onload','end','11058985ThCgpJ','PythonFunctions','substr','22nbDnIY','Undefined','binaryFunctionQueue','jsFunctionDict','sendBinary','stringify','onmessageprocessed','00\x20','getPythonFunctionLibrary','innerHTML','serverName','registerMultipleCallbackPythonFunction'];a0_0x2316=function(){return _0x4fd29b;};return a0_0x2316();}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remotepy",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "JavaScript library to connect to RemotePy server. Allows you to call python functions on server from JavaScript.",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "remotepy.1.1.0.min.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "npm run process",
|
|
8
8
|
"process": "npm run minify && npm run obfuscate",
|
|
@@ -37,8 +37,5 @@
|
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"build/remotepy.minobs.js"
|
|
40
|
-
]
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"ws": "^8.13.0"
|
|
43
|
-
}
|
|
40
|
+
]
|
|
44
41
|
}
|