pinokiod 1.0.49 → 1.0.51
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/kernel/api/fs/index.js +2 -1
- package/kernel/python/index.js +5 -2
- package/package.json +1 -1
package/kernel/api/fs/index.js
CHANGED
package/kernel/python/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
|
-
const nodecallspython = require("node-calls-python");
|
|
3
2
|
class Python {
|
|
4
3
|
constructor(kernel) {
|
|
5
4
|
this.kernel = kernel
|
|
6
5
|
}
|
|
7
|
-
async call(modname, modpath, method, args) {
|
|
6
|
+
async call(modname, modpath, method, args, ondata) {
|
|
7
|
+
console.log("CALL", { modname, modpath, method, args })
|
|
8
8
|
// if this.proc doesn't exist, create
|
|
9
9
|
if (!this.proc) {
|
|
10
10
|
await this.kernel.exec({
|
|
@@ -14,7 +14,9 @@ class Python {
|
|
|
14
14
|
],
|
|
15
15
|
conda: "base"
|
|
16
16
|
}, (s) => {
|
|
17
|
+
ondata(s)
|
|
17
18
|
})
|
|
19
|
+
console.log("Start uvicorn", __dirname)
|
|
18
20
|
await new Promise((resolve, reject) => {
|
|
19
21
|
this.kernel.exec({
|
|
20
22
|
message: "uvicorn --port 42001 server:app",
|
|
@@ -22,6 +24,7 @@ class Python {
|
|
|
22
24
|
conda: "base"
|
|
23
25
|
}, (s) => {
|
|
24
26
|
// process.stdout.write(s)
|
|
27
|
+
ondata(s)
|
|
25
28
|
if (/Uvicorn running on/i.test(s.cleaned)) {
|
|
26
29
|
resolve()
|
|
27
30
|
}
|