remotepy 1.0.1 → 1.0.3
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 +36 -24
- package/build/remotepy.minobs.js +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -4,40 +4,52 @@ 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
|
-
|
|
7
|
+
####Requirements
|
|
8
|
+
|
|
8
9
|
Please make sure you have a remotepy server that you are connecting to.
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
####Installation instructions
|
|
13
14
|
|
|
14
|
-
###Installation instructions:
|
|
15
15
|
```
|
|
16
16
|
npm install remotepy
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
####
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
```
|
|
19
|
+
####Sample JavaScript client
|
|
20
|
+
|
|
21
|
+
#### index.html
|
|
23
22
|
|
|
24
23
|
```html
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
<!DOCTYPE html>
|
|
25
|
+
<html lang="en">
|
|
26
|
+
<head>
|
|
27
|
+
<meta charset="UTF-8">
|
|
28
|
+
<title>Remotepy Test Page</title>
|
|
29
|
+
|
|
30
|
+
<script type="module">
|
|
31
|
+
import { RemotePyClient } from 'https://unpkg.com/remotepy@1.0.2/build/remotepy.minobs.js';
|
|
32
|
+
const client = new RemotePyClient('ws://server:port');
|
|
33
|
+
const remotepy = client.getServerAPI();
|
|
34
|
+
|
|
35
|
+
window.onload = function() {
|
|
36
|
+
client.connect();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
client.onopen = function() {
|
|
40
|
+
remotepy.add(2, 3, function(sum) {
|
|
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>
|
|
42
54
|
|
|
43
55
|
```
|
package/build/remotepy.minobs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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();}
|
|
1
|
+
function a0_0x1a16(){var _0x1c4ad0=['callMultipleCallbackPythonFunction','end','45CINvhR','addPostCloseEventHandler','push','\x27].slice(0,\x20-1);\x0a','JS2PY_SESSION_ID','addPreMessageEventHandler','bind','isOpen','onclose','PythonFunctionsHelp','length','The\x20dropped\x20file\x20is\x20an\x20image:\x20','oninit','7355qAMKkV','jsFunctionDict','slice','1624360yffUkE','getSessionId','onload','map','blob','args','error','var\x20paramNames\x20=\x20this.PythonFunctionsArgs[\x27','1866ANfFed','getServerString','getServerAPI','sendNonImageBinary','PostMessageEventHandlers','match','createJSProxyFunctions','substr','parse','Connection\x20not\x20open.','callFunc','...func','serverName','func','pythonCallbackDict','onopen','readAsDataURL','registerCallbackToPythonFunction','result','PythonFunctionsArgs','1LSCJNy','clientPageId','3576iQLVAl','getPythonFunctionLibrary','stream_index','\x20closed.','onmessageprocessed','PostOpenEventHandlers','data','readAsArrayBuffer','4gxGddC','target','wss','1225yCSBRN','getElementById','onmessage','isBinary','shift','callback','type','Too\x20many\x20callbacks\x20for\x20','9328980iYXrlZ','readCallbackArguments','stringify','binaryFunctionQueue','PreMessageEventHandlers','1407975AGIvNI','Message\x20received:\x20','PreCloseEventHandlers','addPostMessageEventHandler','sendBinary','pythonMultipleCallbackDict','forEach','PostCloseEventHandlers','row','\x20...','504486CAHuqa','1526580FToEQt','streaming','No\x20function\x20callback\x20defined\x20for\x20','funcName','onmessagereceived','buffer','indexOf','sendImageBinary','log','00\x20','src','socket','function','StatusBar','Function\x20:\x20','PreOpenEventHandlers','send','apply','toString','callPythonFunction','registerJSFunctionToBeCalledByPython','PythonFunctions','readyState','\x27,\x20inputObject,\x20...func);','\x20called\x20with\x20arguments:\x20','stream_item','stream_empty','The\x20dropped\x20file\x20is\x20not\x20an\x20image:\x20','return','getPythonFunctionLibraryHelp','registerMultipleCallbackPythonFunction','addPreCloseEventHandler','ws://localhost:80','No\x20function\x20defined\x20for\x20'];a0_0x1a16=function(){return _0x1c4ad0;};return a0_0x1a16();}(function(_0x4046ed,_0x84ce67){var _0x3b0906=a0_0xc711,_0x4764f8=_0x4046ed();while(!![]){try{var _0xa93900=-parseInt(_0x3b0906(0xa0))/0x1*(parseInt(_0x3b0906(0xc4))/0x2)+parseInt(_0x3b0906(0xba))/0x3*(-parseInt(_0x3b0906(0xaa))/0x4)+parseInt(_0x3b0906(0x81))/0x5*(-parseInt(_0x3b0906(0x8c))/0x6)+parseInt(_0x3b0906(0xad))/0x7*(parseInt(_0x3b0906(0xa2))/0x8)+parseInt(_0x3b0906(0x74))/0x9*(parseInt(_0x3b0906(0x84))/0xa)+parseInt(_0x3b0906(0xc5))/0xb+parseInt(_0x3b0906(0xb5))/0xc;if(_0xa93900===_0x84ce67)break;else _0x4764f8['push'](_0x4764f8['shift']());}catch(_0x306987){_0x4764f8['push'](_0x4764f8['shift']());}}}(a0_0x1a16,0x9935f));function RemotePyClient(_0x2a1cf3,_0x523f1f){var _0x152d02=a0_0xc711;if(_0x2a1cf3===undefined)this[_0x152d02(0x98)]=_0x152d02(0xe5);else this[_0x152d02(0x98)]=_0x2a1cf3;if(_0x523f1f===undefined)this[_0x152d02(0xa1)]=_0x152d02(0xac);else this[_0x152d02(0xa1)]=_0x523f1f;this[_0x152d02(0x7b)]=![],this[_0x152d02(0x82)]=[],this[_0x152d02(0x9a)]=[],this['binaryFunctionQueue']=[],this[_0x152d02(0xda)]={},this[_0x152d02(0xd0)]=null,this[_0x152d02(0x7d)]={},this[_0x152d02(0xbf)]={},this['PythonFunctionsArgs']={},this['JS2Py']={};let _0x31614d=null;this[_0x152d02(0xd4)]=[],this[_0x152d02(0xbc)]=[],this[_0x152d02(0xb9)]=[],this[_0x152d02(0xa7)]=[],this[_0x152d02(0xc1)]=[],this[_0x152d02(0x90)]=[],this['addPreOpenEventHandler']=_0x413908=>this[_0x152d02(0xd4)][_0x152d02(0x76)](_0x413908),this[_0x152d02(0xe4)]=_0x14d6df=>this[_0x152d02(0xbc)][_0x152d02(0x76)](_0x14d6df),this[_0x152d02(0x79)]=_0x47027d=>this[_0x152d02(0xb9)][_0x152d02(0x76)](_0x47027d),this['addPostOpenEventHandler']=_0x342454=>this[_0x152d02(0xa7)][_0x152d02(0x76)](_0x342454),this[_0x152d02(0x75)]=_0x2d76b5=>this[_0x152d02(0xc1)]['push'](_0x2d76b5),this[_0x152d02(0xbd)]=_0x580857=>this[_0x152d02(0x90)]['push'](_0x580857),this[_0x152d02(0x8d)]=function(){var _0x141442=_0x152d02;return this[_0x141442(0x98)]+'/'+this[_0x141442(0xa1)];},this[_0x152d02(0xb6)]=function(_0x16894a,..._0x760de5){var _0xf2776c=_0x152d02;for(var _0x343e73=_0x760de5['length']-0x1;_0x343e73>=0x0;--_0x343e73){if(typeof _0x760de5[_0x343e73]!==_0xf2776c(0xd1))break;}var _0x2ddb06=_0x760de5['slice'](0x0,_0x343e73+0x1),_0x31ef09=_0x760de5[_0xf2776c(0x83)](_0x343e73+0x1);return[_0x16894a,_0x2ddb06,_0x31ef09];},this[_0x152d02(0xe3)]=function(_0x47d3b1,..._0x5e4f2d){var _0x4efd0e=_0x152d02;this[_0x4efd0e(0xbf)][_0x47d3b1]=_0x5e4f2d;},this['callMultipleCallbackPythonFunction']=function(_0x5aebc1,..._0x226360){var _0x234520=_0x152d02,_0x3fcd9a=this[_0x234520(0xb6)](_0x5aebc1,..._0x226360);_0x5aebc1=_0x3fcd9a[0x0];let _0x3b4273=_0x3fcd9a[0x1][0x0],_0x3fb3e0=_0x3fcd9a[0x2];this['isOpen']?(this[_0x234520(0xd0)]['send'](JSON[_0x234520(0xb7)]({'funcName':_0x5aebc1,'args':_0x3b4273,'session_id':this[_0x234520(0x85)]()})),console[_0x234520(0xcd)](_0x234520(0xd3)+_0x5aebc1+_0x234520(0xdd),_0x3b4273)):console[_0x234520(0xcd)](_0x234520(0x95)),_0x3fb3e0[_0x234520(0x7e)]>0x0&&this[_0x234520(0xe3)](_0x5aebc1,..._0x3fb3e0);},this['registerCallbackToPythonFunction']=function(_0x148f3a,_0x3b4614){var _0x48bee5=_0x152d02,_0x472d49=this[_0x48bee5(0x9a)][_0x48bee5(0x87)](function(_0x2b9e8b){return _0x2b9e8b['funcName'];})[_0x48bee5(0xcb)](_0x148f3a);_0x472d49<0x0?this[_0x48bee5(0x9a)][_0x48bee5(0x76)]({'funcName':_0x148f3a,'callback':_0x3b4614}):this['pythonCallbackDict'][_0x472d49][_0x48bee5(0xb2)]=_0x3b4614;},this[_0x152d02(0x85)]=function(){var _0xd514a4=_0x152d02;return sessionStorage['getItem'](_0xd514a4(0x78));},this[_0x152d02(0xd9)]=function(_0x154f18,_0x4703f9){var _0xd580e=_0x152d02;this[_0xd580e(0x82)]['push']({'funcName':_0x154f18,'func':_0x4703f9});},this['callFunc']=function(_0xbb1e0b,_0x5ecd8f,_0x47cfb9){var _0x58dac2=_0x152d02;this['isOpen']?(this[_0x58dac2(0xd0)]['send'](JSON[_0x58dac2(0xb7)]({'funcName':_0xbb1e0b,'args':_0x5ecd8f,'session_id':this[_0x58dac2(0x85)]()})),console[_0x58dac2(0xcd)](_0x58dac2(0xd3)+_0xbb1e0b+_0x58dac2(0xdd),_0x5ecd8f)):console[_0x58dac2(0xcd)](_0x58dac2(0x95));if(_0x47cfb9===undefined){}else this[_0x58dac2(0x9d)](_0xbb1e0b,_0x47cfb9);},this[_0x152d02(0xd8)]=function(_0x360bf0,_0x52f963,..._0x17fd1c){var _0x36b740=_0x152d02;this[_0x36b740(0xe7)](_0x360bf0,_0x52f963,..._0x17fd1c);},this['callPythonFunctionBinary']=function(_0xdf6ed,_0x372561,_0x512541,_0x477357){var _0x347f7c=_0x152d02;_0x372561===undefined&&(_0x372561={});_0x372561[_0x347f7c(0xb0)]=!![],this[_0x347f7c(0x96)](_0xdf6ed,_0x372561);if(this[_0x347f7c(0x7b)]){this[_0x347f7c(0xbe)](_0x512541);if(_0x477357===undefined){}else this[_0x347f7c(0x9d)](_0xdf6ed,_0x477357);}else console[_0x347f7c(0xcd)](_0x347f7c(0x95));},this[_0x152d02(0xbe)]=function(_0x50c322){var _0x4fc9e6=_0x152d02,_0x1ab128=new FileReader();_0x1ab128[_0x4fc9e6(0x86)]=function(_0x149936){var _0x477e0b=_0x4fc9e6,_0x4391d0=_0x149936['target'][_0x477e0b(0x9e)];if(this['socket']&&this[_0x477e0b(0xd0)][_0x477e0b(0xdb)]==0x1)this['socket'][_0x477e0b(0xd5)](_0x4391d0);},_0x1ab128[_0x4fc9e6(0xa9)](_0x50c322);},this[_0x152d02(0x8f)]=function(_0x4b52d0){var _0x8c8f1d=_0x152d02;if(_0x4b52d0[_0x8c8f1d(0xb3)][_0x8c8f1d(0x91)](/image.*/)){console[_0x8c8f1d(0xcd)](_0x8c8f1d(0x7f),_0x4b52d0[_0x8c8f1d(0xb3)]);return;}var _0x33fbd3=new FileReader();_0x33fbd3[_0x8c8f1d(0x86)]=function(_0x45350d){var _0x8edb9c=_0x8c8f1d,_0xbb1e04=_0x45350d[_0x8edb9c(0xab)][_0x8edb9c(0x9e)];if(this['socket']&&this['socket'][_0x8edb9c(0xdb)]==0x1)this[_0x8edb9c(0xd0)][_0x8edb9c(0xd5)](_0xbb1e04);},_0x33fbd3[_0x8c8f1d(0xa9)](_0x4b52d0);},this[_0x152d02(0xcc)]=function(_0x2949ed){var _0x14cbf8=_0x152d02;if(!_0x2949ed['type'][_0x14cbf8(0x91)](/image.*/)){console[_0x14cbf8(0xcd)](_0x14cbf8(0xe0),_0x2949ed['type']);return;}var _0x7afe0f=new FileReader();_0x7afe0f[_0x14cbf8(0x86)]=function(_0x7a7e25){var _0x56e321=_0x14cbf8,_0x69ce26=_0x7a7e25[_0x56e321(0xab)][_0x56e321(0x9e)];if(this[_0x56e321(0xd0)]&&this['socket'][_0x56e321(0xdb)]==0x1)this[_0x56e321(0xd0)][_0x56e321(0xd5)](_0x69ce26);},_0x7afe0f[_0x14cbf8(0xa9)](_0x2949ed);},this[_0x152d02(0x92)]=function(_0x291041){var _0x49399e=_0x152d02;for(var _0x21222a in this['PythonFunctionsArgs']){var _0x159466=this[_0x49399e(0x9f)][_0x21222a];_0x159466[_0x49399e(0x76)](_0x49399e(0x97));var _0x271889=_0x49399e(0x8b)+_0x21222a+_0x49399e(0x77)+'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'+_0x21222a+_0x49399e(0xdc);_0x159466[_0x49399e(0x76)](_0x271889),_0x31614d=this;if(_0x21222a['indexOf']('.')>=0x0){var _0xdbda75=_0x21222a['split']('.'),_0x65bc5e=this[_0x49399e(0xda)];for(var _0x4b5c21=0x0;_0x4b5c21<_0xdbda75[_0x49399e(0x7e)]-0x1;_0x4b5c21++){!(_0xdbda75[_0x4b5c21]in _0x65bc5e)&&(_0x65bc5e[_0xdbda75[_0x4b5c21]]={}),_0x65bc5e=_0x65bc5e[_0xdbda75[_0x4b5c21]];}_0x65bc5e[_0xdbda75[_0xdbda75['length']-0x1]]=Function[_0x49399e(0xd6)](null,_0x159466)[_0x49399e(0x7a)](this);}else this[_0x49399e(0xda)][_0x21222a]=Function['apply'](null,_0x159466)[_0x49399e(0x7a)](this);}},this['connect']=function(){var _0x4a85c0=_0x152d02;this['oninit']!==undefined&&this[_0x4a85c0(0x80)]();var _0x11e1bb=this[_0x4a85c0(0x8d)]();console[_0x4a85c0(0xcd)]('Connecting\x20to\x20:\x20'+_0x11e1bb+_0x4a85c0(0xc3)),this[_0x4a85c0(0xd0)]=new WebSocket(_0x11e1bb),this[_0x4a85c0(0xd0)]['binaryType']='arraybuffer',_0x31614d=this,this['socket'][_0x4a85c0(0x9b)]=function(){var _0x2c8120=_0x4a85c0;console[_0x2c8120(0xcd)]('Connected\x20to\x20Server\x20:'+_0x11e1bb),_0x31614d['PreOpenEventHandlers'][_0x2c8120(0xc0)](_0x3c4818=>_0x3c4818()),_0x31614d[_0x2c8120(0x7b)]=!![],_0x31614d[_0x2c8120(0x9b)]!==undefined&&(_0x31614d[_0x2c8120(0xe7)](_0x2c8120(0xa3),{},function(_0x81ce1){var _0x1cbbd3=_0x2c8120;_0x31614d['PythonFunctionsArgs']={};for(var _0x879c26 in _0x81ce1){_0x81ce1[_0x879c26][_0x1cbbd3(0xb1)](),_0x81ce1[_0x879c26][0x0]=='session_id'&&_0x81ce1[_0x879c26][_0x1cbbd3(0xb1)](),_0x31614d[_0x1cbbd3(0x9f)][_0x879c26]=_0x81ce1[_0x879c26];}_0x31614d[_0x1cbbd3(0x92)](''),_0x31614d['onopen']();}),_0x31614d[_0x2c8120(0xe7)](_0x2c8120(0xe2),{},function(_0x2d156d){_0x31614d['PythonFunctionsHelp']=_0x2d156d;})),_0x31614d[_0x2c8120(0xa7)][_0x2c8120(0xc0)](_0x4a44a4=>_0x4a44a4());},this['socket'][_0x4a85c0(0xaf)]=function(_0x573649){var _0x5e8a91=_0x4a85c0;_0x31614d[_0x5e8a91(0xb9)]['forEach'](_0x477b9e=>_0x477b9e());_0x31614d['onmessagereceived']!==undefined&&_0x31614d[_0x5e8a91(0xc9)](_0x573649);if(typeof _0x573649[_0x5e8a91(0xa8)]=='string'){var _0x2cb4f3=JSON[_0x5e8a91(0x94)](_0x573649[_0x5e8a91(0xa8)]);console[_0x5e8a91(0xcd)](_0x5e8a91(0xbb),_0x2cb4f3);if(_0x5e8a91(0x89)in _0x2cb4f3){var _0x53164a=_0x31614d[_0x5e8a91(0x82)][_0x5e8a91(0x87)](function(_0x369bdf){return _0x369bdf['funcName'];})[_0x5e8a91(0xcb)](_0x2cb4f3['funcName']);if(_0x53164a>=0x0){var _0x33d414=_0x31614d[_0x5e8a91(0x82)][_0x53164a];_0x5e8a91(0xb0)in _0x2cb4f3[_0x5e8a91(0x89)]?_0x31614d[_0x5e8a91(0xb8)][_0x5e8a91(0x76)]({'funcName':_0x2cb4f3[_0x5e8a91(0xc8)],'callback':_0x33d414['func'],'args':_0x2cb4f3['args']}):_0x33d414[_0x5e8a91(0x99)](_0x2cb4f3['args']);}else{if(_0x2cb4f3[_0x5e8a91(0xc8)]===_0x5e8a91(0xa3))return;else throw _0x5e8a91(0xe6)+_0x2cb4f3[_0x5e8a91(0xc8)];}}else{if(_0x5e8a91(0xc6)in _0x2cb4f3){if(_0x2cb4f3[_0x5e8a91(0xc8)]in _0x31614d['pythonMultipleCallbackDict']){var _0x1c1a2e=_0x31614d[_0x5e8a91(0xbf)][_0x2cb4f3['funcName']];switch(_0x1c1a2e['length']){case 0x0:break;case 0x1:if(_0x5e8a91(0x8a)in _0x2cb4f3)_0x1c1a2e[0x0](_0x2cb4f3['error'],![]);if('return'in _0x2cb4f3)_0x1c1a2e[0x0](_0x2cb4f3[_0x5e8a91(0xc6)],_0x2cb4f3[_0x5e8a91(0xe1)],![]);break;case 0x2:if('error'in _0x2cb4f3)_0x1c1a2e[0x0](_0x2cb4f3[_0x5e8a91(0x8a)],![]);if('return'in _0x2cb4f3)_0x1c1a2e[0x0](_0x2cb4f3[_0x5e8a91(0xc6)],_0x2cb4f3[_0x5e8a91(0xe1)],![]);if(_0x2cb4f3[_0x5e8a91(0xc6)]==_0x5e8a91(0xc2))_0x1c1a2e[0x1](_0x2cb4f3[_0x5e8a91(0xa4)],_0x2cb4f3[_0x5e8a91(0xde)],![]);break;case 0x3:if(_0x5e8a91(0x8a)in _0x2cb4f3)_0x1c1a2e[0x0](_0x2cb4f3[_0x5e8a91(0x8a)],![]);if(_0x2cb4f3[_0x5e8a91(0xc6)]=='start')_0x1c1a2e[0x0](_0x2cb4f3[_0x5e8a91(0xe1)],![]);if(_0x2cb4f3[_0x5e8a91(0xc6)]==_0x5e8a91(0xc2))_0x1c1a2e[0x1](_0x2cb4f3[_0x5e8a91(0xa4)],_0x2cb4f3['stream_item'],![]);if(_0x2cb4f3['streaming']=='end')_0x1c1a2e[0x2](_0x2cb4f3[_0x5e8a91(0xdf)],![]);break;case 0x4:if(_0x5e8a91(0x8a)in _0x2cb4f3)_0x1c1a2e[0x4](_0x2cb4f3[_0x5e8a91(0x8a)],![]);if(_0x2cb4f3[_0x5e8a91(0xc6)]=='start')_0x1c1a2e[0x0](_0x2cb4f3['return'],![]);if(_0x2cb4f3['streaming']==_0x5e8a91(0xc2))_0x1c1a2e[0x1](_0x2cb4f3['stream_index'],_0x2cb4f3['stream_item'],![]);if(_0x2cb4f3[_0x5e8a91(0xc6)]==_0x5e8a91(0xe8))_0x1c1a2e[0x2](_0x2cb4f3[_0x5e8a91(0xdf)],![]);break;default:throw _0x5e8a91(0xb4)+_0x2cb4f3['funcName'];}}else throw _0x5e8a91(0xc7)+_0x2cb4f3[_0x5e8a91(0xc8)];}else{if(_0x2cb4f3[_0x5e8a91(0xc8)]in _0x31614d[_0x5e8a91(0xbf)]){var _0x1c1a2e=_0x31614d[_0x5e8a91(0xbf)][_0x2cb4f3[_0x5e8a91(0xc8)]];switch(_0x1c1a2e[_0x5e8a91(0x7e)]){case 0x0:break;case 0x1:if(_0x5e8a91(0x8a)in _0x2cb4f3)_0x1c1a2e[0x0](_0x2cb4f3[_0x5e8a91(0x8a)],![]);if('return'in _0x2cb4f3)_0x1c1a2e[0x0](_0x2cb4f3[_0x5e8a91(0xe1)],![]);break;case 0x2:if('error'in _0x2cb4f3)_0x1c1a2e[0x1](_0x2cb4f3[_0x5e8a91(0x8a)],![]);if(_0x5e8a91(0xe1)in _0x2cb4f3)_0x1c1a2e[0x0](_0x2cb4f3[_0x5e8a91(0xe1)],![]);break;case 0x3:if(_0x5e8a91(0x8a)in _0x2cb4f3)_0x1c1a2e[0x0](_0x2cb4f3['error'],![]);if(_0x5e8a91(0xe1)in _0x2cb4f3)_0x1c1a2e[0x0](_0x2cb4f3[_0x5e8a91(0xe1)],![]);break;default:throw'Too\x20many\x20callbacks\x20for\x20'+_0x2cb4f3[_0x5e8a91(0xc8)];}}else{var _0x53164a=_0x31614d[_0x5e8a91(0x9a)][_0x5e8a91(0x87)](function(_0x12204b){var _0x41995c=_0x5e8a91;return _0x12204b[_0x41995c(0xc8)];})[_0x5e8a91(0xcb)](_0x2cb4f3['funcName']);if(_0x53164a>=0x0){var _0x33d414=_0x31614d[_0x5e8a91(0x9a)][_0x53164a];_0x2cb4f3[_0x5e8a91(0xe1)]===undefined?_0x2cb4f3[_0x5e8a91(0x8a)]!==undefined&&_0x33d414[_0x5e8a91(0xb2)](_0x2cb4f3[_0x5e8a91(0x8a)],![]):_0x33d414[_0x5e8a91(0xb2)](_0x2cb4f3[_0x5e8a91(0xe1)],!![]);}else throw _0x5e8a91(0xe6)+_0x2cb4f3[_0x5e8a91(0xc8)];}}}}else{var _0x53708d=new Uint8Array(_0x573649[_0x5e8a91(0xa8)]),_0x58ad62='\x20';for(var _0x55f8d8=0x0;_0x55f8d8<_0x53708d[_0x5e8a91(0x7e)];_0x55f8d8++){_0x58ad62+=(_0x5e8a91(0xce)+_0x53708d[_0x55f8d8][_0x5e8a91(0xd7)](0x10))[_0x5e8a91(0x93)](-0x2);}var _0x5d9043=_0x573649['data'],_0x4992f8=new Uint8Array(_0x5d9043),_0x52fe27=new Blob([_0x4992f8[_0x5e8a91(0xca)]]);if(_0x31614d[_0x5e8a91(0xb8)][_0x5e8a91(0x7e)]>0x0){var _0x398d71=_0x31614d[_0x5e8a91(0xb8)][_0x5e8a91(0xb1)]();_0x398d71[_0x5e8a91(0x89)][_0x5e8a91(0x88)]=_0x52fe27,_0x398d71[_0x5e8a91(0xb2)](_0x398d71[_0x5e8a91(0x89)]);}else{var _0x57216c=new FileReader();_0x57216c[_0x5e8a91(0x86)]=function(_0xb6b5e){var _0x22a422=_0x5e8a91;imgFig[_0x22a422(0xcf)]=_0xb6b5e[_0x22a422(0xab)][_0x22a422(0x9e)];},_0x57216c[_0x5e8a91(0x9c)](_0x52fe27),document[_0x5e8a91(0xae)](_0x5e8a91(0xd2))['innerHTML']='Chart\x20Loading\x20Completed\x20...';}console['log']('message(b)\x20received\x20:\x20',_0x58ad62);}_0x31614d[_0x5e8a91(0xa6)]!==undefined&&_0x31614d['onmessageprocessed'](),_0x31614d[_0x5e8a91(0x90)][_0x5e8a91(0xc0)](_0x4c274c=>_0x4c274c());},this[_0x4a85c0(0xd0)][_0x4a85c0(0x7c)]=function(_0x433b4e){var _0xa13775=_0x4a85c0;console[_0xa13775(0xcd)]('Connection\x20to\x20'+_0x11e1bb+_0xa13775(0xa5)),_0x31614d[_0xa13775(0xbc)]['forEach'](_0x5a071e=>_0x5a071e(_0x433b4e)),_0x31614d[_0xa13775(0x7b)]=![],this[_0xa13775(0xd0)]=null,_0x31614d['onclose']!==undefined&&_0x31614d[_0xa13775(0x7c)](_0x433b4e),_0x31614d[_0xa13775(0xc1)][_0xa13775(0xc0)](_0x15026a=>_0x15026a(_0x433b4e));};},this[_0x152d02(0x8e)]=function(){var _0x1fc47c=_0x152d02;return this[_0x1fc47c(0xda)];},this['getService']=function(_0x7a7f2f){var _0x5cb893=_0x152d02;return this[_0x5cb893(0xda)][_0x7a7f2f];};}function a0_0xc711(_0x22a324,_0x41f0b0){var _0x1a165f=a0_0x1a16();return a0_0xc711=function(_0xc71166,_0x5703da){_0xc71166=_0xc71166-0x74;var _0x35e44c=_0x1a165f[_0xc71166];return _0x35e44c;},a0_0xc711(_0x22a324,_0x41f0b0);}export{RemotePyClient};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remotepy",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "JavaScript library to connect to RemotePy server. Allows you to call python functions on server from JavaScript.",
|
|
5
|
-
"main": "remotepy.
|
|
5
|
+
"main": "build/remotepy.minobs.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "npm run process",
|
|
8
8
|
"process": "npm run minify && npm run obfuscate",
|
|
@@ -37,5 +37,9 @@
|
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"build/remotepy.minobs.js"
|
|
40
|
-
]
|
|
40
|
+
],
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"remotepy": "^1.0.0",
|
|
43
|
+
"ws": "^8.13.0"
|
|
44
|
+
}
|
|
41
45
|
}
|