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 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).then(async () => {
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()
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)
@@ -28,20 +28,25 @@ class Python {
28
28
  })
29
29
  }
30
30
 
31
- let res = await fetch("http://127.0.0.1:42001/call", {
32
- method: "POST",
33
- headers: { "Content-Type": "application/json" },
34
- body: JSON.stringify({
35
- name: modname,
36
- path: modpath,
37
- method,
38
- params: args
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
- }).then((res) => {
41
- return res.json()
42
- })
43
- this.proc = true
44
- return res
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.2.146",
3
+ "version": "3.2.148",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {