@basthon/kernel-python3 0.36.5 → 0.36.9

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.
@@ -175,6 +175,6 @@ Module['FS_createPath']('/lib/python3.8/site-packages', 'basthon', true, true);
175
175
  }
176
176
 
177
177
  }
178
- loadPackage({"files": [{"filename": "/lib/python3.8/site-packages/basthon/utils.py", "start": 0, "end": 2379, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/_patch_modules.py", "start": 2379, "end": 14111, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/_pyodide_base.py", "start": 14111, "end": 27245, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/_patch_builtins.py", "start": 27245, "end": 29523, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/_pyodide_console.py", "start": 29523, "end": 41118, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/kernel.py", "start": 41118, "end": 45592, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/_console.py", "start": 45592, "end": 50508, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/packages.py", "start": 50508, "end": 56744, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/__init__.py", "start": 56744, "end": 57082, "audio": 0}], "remote_package_size": 38303, "package_uuid": "11b4d68f-97eb-401e-a31e-7d6465311b19"});
178
+ loadPackage({"files": [{"filename": "/lib/python3.8/site-packages/basthon/utils.py", "start": 0, "end": 2379, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/_patch_modules.py", "start": 2379, "end": 14111, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/_pyodide_base.py", "start": 14111, "end": 27245, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/_patch_builtins.py", "start": 27245, "end": 29523, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/_pyodide_console.py", "start": 29523, "end": 41118, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/kernel.py", "start": 41118, "end": 45592, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/_console.py", "start": 45592, "end": 50508, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/packages.py", "start": 50508, "end": 56744, "audio": 0}, {"filename": "/lib/python3.8/site-packages/basthon/__init__.py", "start": 56744, "end": 57082, "audio": 0}], "remote_package_size": 38303, "package_uuid": "65fa021f-ae0f-4b0c-b026-598a204fa0b5"});
179
179
 
180
180
  })();
package/lib/kernel.d.ts CHANGED
@@ -77,4 +77,12 @@ export declare class KernelPython3 extends KernelBase {
77
77
  * and the start index.
78
78
  */
79
79
  complete(code: string): any;
80
+ /**
81
+ * Change current directory (Python's virtual FS).
82
+ */
83
+ chdir(path: string): void;
84
+ /**
85
+ * Create directory (Python's virtual FS).
86
+ */
87
+ mkdir(path: string): void;
80
88
  }
package/lib/kernel.js CHANGED
@@ -41,7 +41,6 @@ export class KernelPython3 extends KernelBase {
41
41
  // removing basthon from global namespace
42
42
  await pyodide.runPythonAsync("del __basthon__");
43
43
  }
44
- ;
45
44
  /**
46
45
  * Start the Basthon kernel asynchronously.
47
46
  */
@@ -70,7 +69,6 @@ export class KernelPython3 extends KernelBase {
70
69
  // waiting until page is loaded
71
70
  await this.pageLoad();
72
71
  }
73
- ;
74
72
  /**
75
73
  * Basthon async code evaluation function.
76
74
  */
@@ -84,21 +82,18 @@ export class KernelPython3 extends KernelBase {
84
82
  // loading dependencies are loaded by eval
85
83
  return await this.__kernel__.eval(code, outCallback, errCallback, data);
86
84
  }
87
- ;
88
85
  /**
89
86
  * Restart the kernel.
90
87
  */
91
88
  restart() {
92
89
  return this.__kernel__.restart();
93
90
  }
94
- ;
95
91
  /**
96
92
  * Put a file on the local (emulated) filesystem.
97
93
  */
98
94
  putFile(filename, content) {
99
95
  this.__kernel__.put_file(filename, content);
100
96
  }
101
- ;
102
97
  /**
103
98
  * Put an importable module on the local (emulated) filesystem
104
99
  * and load dependencies.
@@ -106,28 +101,24 @@ export class KernelPython3 extends KernelBase {
106
101
  putModule(filename, content) {
107
102
  return this.__kernel__.put_module(filename, content);
108
103
  }
109
- ;
110
104
  /**
111
105
  * List modules launched via putModule.
112
106
  */
113
107
  userModules() {
114
108
  return this.__kernel__.user_modules();
115
109
  }
116
- ;
117
110
  /**
118
111
  * Download a file from the VFS.
119
112
  */
120
113
  getFile(path) {
121
114
  return this.__kernel__.get_file(path);
122
115
  }
123
- ;
124
116
  /**
125
117
  * Download a user module file.
126
118
  */
127
119
  getUserModuleFile(filename) {
128
120
  return this.__kernel__.get_user_module_file(filename);
129
121
  }
130
- ;
131
122
  /**
132
123
  * Is the source ready to be evaluated or want we more?
133
124
  * Usefull to set ps1/ps2 for teminal prompt.
@@ -135,14 +126,12 @@ export class KernelPython3 extends KernelBase {
135
126
  more(source) {
136
127
  return this.__kernel__.more(source);
137
128
  }
138
- ;
139
129
  /**
140
130
  * Mimic the CPython's REPL banner.
141
131
  */
142
132
  banner() {
143
133
  return this.__kernel__.banner();
144
134
  }
145
- ;
146
135
  /**
147
136
  * Complete a code at the end (usefull for tab completion).
148
137
  *
@@ -152,5 +141,16 @@ export class KernelPython3 extends KernelBase {
152
141
  complete(code) {
153
142
  return this.__kernel__.complete(code);
154
143
  }
155
- ;
144
+ /**
145
+ * Change current directory (Python's virtual FS).
146
+ */
147
+ chdir(path) {
148
+ window.pyodide._module.FS.chdir(path);
149
+ }
150
+ /**
151
+ * Create directory (Python's virtual FS).
152
+ */
153
+ mkdir(path) {
154
+ window.pyodide._module.FS.mkdir(path);
155
+ }
156
156
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basthon/kernel-python3",
3
- "version": "0.36.5",
3
+ "version": "0.36.9",
4
4
  "description": "Basthon - Python3 Kernel",
5
5
  "homepage": "https://basthon.fr",
6
6
  "bugs": {
@@ -25,7 +25,7 @@
25
25
  "clean": "make clean"
26
26
  },
27
27
  "dependencies": {
28
- "@basthon/kernel-base": "^0.36.5"
28
+ "@basthon/kernel-base": "^0.36.9"
29
29
  },
30
30
  "devDependencies": {
31
31
  "gulp": "^4.0.2",
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "9d7e47b7e7fa8ba8cbaa4bcf77fe1f282fca79d0"
43
+ "gitHead": "2ac9c2f46fbc59de60d424534463748ad9da9f5c"
44
44
  }