pinokiod 3.2.146 → 3.2.148
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/index.js +11 -13
- package/kernel/python/index.js +18 -13
- package/package.json +1 -1
package/kernel/index.js
CHANGED
|
@@ -368,19 +368,17 @@ class Kernel {
|
|
|
368
368
|
})
|
|
369
369
|
console.log("> 2")
|
|
370
370
|
this.sys = new Sysinfo()
|
|
371
|
-
this.sys.init(this)
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
})
|
|
383
|
-
console.log("> 3")
|
|
371
|
+
await this.sys.init(this)
|
|
372
|
+
let info = this.sys.info
|
|
373
|
+
await fs.promises.mkdir(this.path("logs"), { recursive: true }).catch((e) => { })
|
|
374
|
+
await fs.promises.writeFile(this.path("logs/system.json"), JSON.stringify({
|
|
375
|
+
platform: this.platform,
|
|
376
|
+
arch: this.arch,
|
|
377
|
+
home: this.homedir,
|
|
378
|
+
...info
|
|
379
|
+
}, null, 2))
|
|
380
|
+
this.sysinfo = info
|
|
381
|
+
await this.update_sysinfo()
|
|
384
382
|
/*
|
|
385
383
|
this.sys = new Sysinfo()
|
|
386
384
|
await this.sys.init(this)
|
package/kernel/python/index.js
CHANGED
|
@@ -28,20 +28,25 @@ class Python {
|
|
|
28
28
|
})
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
try {
|
|
32
|
+
let res = await fetch("http://127.0.0.1:42001/call", {
|
|
33
|
+
method: "POST",
|
|
34
|
+
headers: { "Content-Type": "application/json" },
|
|
35
|
+
body: JSON.stringify({
|
|
36
|
+
name: modname,
|
|
37
|
+
path: modpath,
|
|
38
|
+
method,
|
|
39
|
+
params: args
|
|
40
|
+
})
|
|
41
|
+
}).then((res) => {
|
|
42
|
+
return res.json()
|
|
39
43
|
})
|
|
40
|
-
|
|
41
|
-
return res
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
this.proc = true
|
|
45
|
+
return res
|
|
46
|
+
} catch (e) {
|
|
47
|
+
console.log("FETCH ERROR", e)
|
|
48
|
+
this.proc = false
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
52
|
module.exports = Python
|