|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.MicroPython.MicroPythonCommandsInterface</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.MicroPython.MicroPythonCommandsInterface</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing some file system commands for MicroPython. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#MicroPythonCommandsInterface">MicroPythonCommandsInterface</a></td> |
|
39 <td>Class implementing some file system commands for MicroPython.</td> |
|
40 </tr> |
|
41 </table> |
|
42 <h3>Functions</h3> |
|
43 |
|
44 <table> |
|
45 <tr><td>None</td></tr> |
|
46 </table> |
|
47 <hr /> |
|
48 <hr /> |
|
49 <a NAME="MicroPythonCommandsInterface" ID="MicroPythonCommandsInterface"></a> |
|
50 <h2>MicroPythonCommandsInterface</h2> |
|
51 |
|
52 <p> |
|
53 Class implementing some file system commands for MicroPython. |
|
54 </p> |
|
55 <p> |
|
56 Commands are provided to perform operations on the file system of a |
|
57 connected MicroPython device. Supported commands are: |
|
58 <ul> |
|
59 <li>ls: directory listing</li> |
|
60 <li>lls: directory listing with meta data</li> |
|
61 <li>cd: change directory</li> |
|
62 <li>pwd: get the current directory</li> |
|
63 <li>put: copy a file to the connected device</li> |
|
64 <li>get: get a file from the connected device</li> |
|
65 <li>rm: remove a file from the connected device</li> |
|
66 <li>rmrf: remove a file/directory recursively (like 'rm -rf' in bash) |
|
67 <li>mkdir: create a new directory</li> |
|
68 <li>rmdir: remove an empty directory</li> |
|
69 </ul> |
|
70 </p> |
|
71 <p> |
|
72 There are additional commands related to time and version. |
|
73 <ul> |
|
74 <li>version: get version info about MicroPython</li> |
|
75 <li>getImplementation: get some implementation information</li> |
|
76 <li>syncTime: synchronize the time of the connected device</li> |
|
77 <li>showTime: show the current time of the connected device</li> |
|
78 </ul> |
|
79 </p> |
|
80 <h3>Signals</h3> |
|
81 <dl> |
|
82 |
|
83 <dt>dataReceived(data)</dt> |
|
84 <dd> |
|
85 emitted to send data received via the serial |
|
86 connection for further processing |
|
87 </dd> |
|
88 <dt>executeAsyncFinished()</dt> |
|
89 <dd> |
|
90 emitted to indicate the end of an |
|
91 asynchronously executed list of commands (e.g. a script) |
|
92 </dd> |
|
93 </dl> |
|
94 <h3>Derived from</h3> |
|
95 QObject |
|
96 <h3>Class Attributes</h3> |
|
97 |
|
98 <table> |
|
99 <tr><td>None</td></tr> |
|
100 </table> |
|
101 <h3>Class Methods</h3> |
|
102 |
|
103 <table> |
|
104 <tr><td>None</td></tr> |
|
105 </table> |
|
106 <h3>Methods</h3> |
|
107 |
|
108 <table> |
|
109 |
|
110 <tr> |
|
111 <td><a href="#MicroPythonCommandsInterface.__init__">MicroPythonCommandsInterface</a></td> |
|
112 <td>Constructor</td> |
|
113 </tr> |
|
114 <tr> |
|
115 <td><a href="#MicroPythonCommandsInterface.__rawOff">__rawOff</a></td> |
|
116 <td>Private method to switch 'raw' mode off.</td> |
|
117 </tr> |
|
118 <tr> |
|
119 <td><a href="#MicroPythonCommandsInterface.__rawOn">__rawOn</a></td> |
|
120 <td>Private method to switch the connected device to 'raw' mode.</td> |
|
121 </tr> |
|
122 <tr> |
|
123 <td><a href="#MicroPythonCommandsInterface.__readSerial">__readSerial</a></td> |
|
124 <td>Private slot to read all available serial data and emit it with the "dataReceived" signal for further processing.</td> |
|
125 </tr> |
|
126 <tr> |
|
127 <td><a href="#MicroPythonCommandsInterface.__shortError">__shortError</a></td> |
|
128 <td>Private method to create a shortened error message.</td> |
|
129 </tr> |
|
130 <tr> |
|
131 <td><a href="#MicroPythonCommandsInterface.cd">cd</a></td> |
|
132 <td>Public method to change the current directory on the connected device.</td> |
|
133 </tr> |
|
134 <tr> |
|
135 <td><a href="#MicroPythonCommandsInterface.connectToDevice">connectToDevice</a></td> |
|
136 <td>Public slot to start the manager.</td> |
|
137 </tr> |
|
138 <tr> |
|
139 <td><a href="#MicroPythonCommandsInterface.disconnectFromDevice">disconnectFromDevice</a></td> |
|
140 <td>Public slot to stop the thread.</td> |
|
141 </tr> |
|
142 <tr> |
|
143 <td><a href="#MicroPythonCommandsInterface.execute">execute</a></td> |
|
144 <td>Public method to send commands to the connected device and return the result.</td> |
|
145 </tr> |
|
146 <tr> |
|
147 <td><a href="#MicroPythonCommandsInterface.executeAsync">executeAsync</a></td> |
|
148 <td>Public method to execute a series of commands over a period of time without returning any result (asynchronous execution).</td> |
|
149 </tr> |
|
150 <tr> |
|
151 <td><a href="#MicroPythonCommandsInterface.fileSystemInfo">fileSystemInfo</a></td> |
|
152 <td>Public method to obtain information about the currently mounted file systems.</td> |
|
153 </tr> |
|
154 <tr> |
|
155 <td><a href="#MicroPythonCommandsInterface.get">get</a></td> |
|
156 <td>Public method to copy a file from the connected device.</td> |
|
157 </tr> |
|
158 <tr> |
|
159 <td><a href="#MicroPythonCommandsInterface.getImplementation">getImplementation</a></td> |
|
160 <td>Public method to get some implementation information of the connected device.</td> |
|
161 </tr> |
|
162 <tr> |
|
163 <td><a href="#MicroPythonCommandsInterface.getTime">getTime</a></td> |
|
164 <td>Public method to get the current time of the device.</td> |
|
165 </tr> |
|
166 <tr> |
|
167 <td><a href="#MicroPythonCommandsInterface.handlePreferencesChanged">handlePreferencesChanged</a></td> |
|
168 <td>Public slot to handle a change of the preferences.</td> |
|
169 </tr> |
|
170 <tr> |
|
171 <td><a href="#MicroPythonCommandsInterface.isConnected">isConnected</a></td> |
|
172 <td>Public method to get the connection status.</td> |
|
173 </tr> |
|
174 <tr> |
|
175 <td><a href="#MicroPythonCommandsInterface.lls">lls</a></td> |
|
176 <td>Public method to get a long directory listing of the connected device including meta data.</td> |
|
177 </tr> |
|
178 <tr> |
|
179 <td><a href="#MicroPythonCommandsInterface.ls">ls</a></td> |
|
180 <td>Public method to get a directory listing of the connected device.</td> |
|
181 </tr> |
|
182 <tr> |
|
183 <td><a href="#MicroPythonCommandsInterface.mkdir">mkdir</a></td> |
|
184 <td>Public method to create a new directory.</td> |
|
185 </tr> |
|
186 <tr> |
|
187 <td><a href="#MicroPythonCommandsInterface.put">put</a></td> |
|
188 <td>Public method to copy a local file to the connected device.</td> |
|
189 </tr> |
|
190 <tr> |
|
191 <td><a href="#MicroPythonCommandsInterface.pwd">pwd</a></td> |
|
192 <td>Public method to get the current directory of the connected device.</td> |
|
193 </tr> |
|
194 <tr> |
|
195 <td><a href="#MicroPythonCommandsInterface.remainingTask">remainingTask</a></td> |
|
196 <td></td> |
|
197 </tr> |
|
198 <tr> |
|
199 <td><a href="#MicroPythonCommandsInterface.rm">rm</a></td> |
|
200 <td>Public method to remove a file from the connected device.</td> |
|
201 </tr> |
|
202 <tr> |
|
203 <td><a href="#MicroPythonCommandsInterface.rmdir">rmdir</a></td> |
|
204 <td>Public method to remove a directory.</td> |
|
205 </tr> |
|
206 <tr> |
|
207 <td><a href="#MicroPythonCommandsInterface.rmrf">rmrf</a></td> |
|
208 <td>Public method to remove a file or directory recursively.</td> |
|
209 </tr> |
|
210 <tr> |
|
211 <td><a href="#MicroPythonCommandsInterface.syncTime">syncTime</a></td> |
|
212 <td>Public method to set the time of the connected device to the local computer's time.</td> |
|
213 </tr> |
|
214 <tr> |
|
215 <td><a href="#MicroPythonCommandsInterface.version">version</a></td> |
|
216 <td>Public method to get the MicroPython version information of the connected device.</td> |
|
217 </tr> |
|
218 <tr> |
|
219 <td><a href="#MicroPythonCommandsInterface.write">write</a></td> |
|
220 <td>Public method to write data to the connected device.</td> |
|
221 </tr> |
|
222 </table> |
|
223 <h3>Static Methods</h3> |
|
224 |
|
225 <table> |
|
226 <tr><td>None</td></tr> |
|
227 </table> |
|
228 |
|
229 <a NAME="MicroPythonCommandsInterface.__init__" ID="MicroPythonCommandsInterface.__init__"></a> |
|
230 <h4>MicroPythonCommandsInterface (Constructor)</h4> |
|
231 <b>MicroPythonCommandsInterface</b>(<i>parent=None</i>) |
|
232 |
|
233 <p> |
|
234 Constructor |
|
235 </p> |
|
236 <dl> |
|
237 |
|
238 <dt><i>parent</i> (QObject)</dt> |
|
239 <dd> |
|
240 reference to the parent object |
|
241 </dd> |
|
242 </dl> |
|
243 <a NAME="MicroPythonCommandsInterface.__rawOff" ID="MicroPythonCommandsInterface.__rawOff"></a> |
|
244 <h4>MicroPythonCommandsInterface.__rawOff</h4> |
|
245 <b>__rawOff</b>(<i></i>) |
|
246 |
|
247 <p> |
|
248 Private method to switch 'raw' mode off. |
|
249 </p> |
|
250 <a NAME="MicroPythonCommandsInterface.__rawOn" ID="MicroPythonCommandsInterface.__rawOn"></a> |
|
251 <h4>MicroPythonCommandsInterface.__rawOn</h4> |
|
252 <b>__rawOn</b>(<i></i>) |
|
253 |
|
254 <p> |
|
255 Private method to switch the connected device to 'raw' mode. |
|
256 </p> |
|
257 <p> |
|
258 Note: switching to raw mode is done with synchronous writes. |
|
259 </p> |
|
260 <dl> |
|
261 <dt>Return:</dt> |
|
262 <dd> |
|
263 flag indicating success |
|
264 @rtype bool |
|
265 </dd> |
|
266 </dl> |
|
267 <a NAME="MicroPythonCommandsInterface.__readSerial" ID="MicroPythonCommandsInterface.__readSerial"></a> |
|
268 <h4>MicroPythonCommandsInterface.__readSerial</h4> |
|
269 <b>__readSerial</b>(<i></i>) |
|
270 |
|
271 <p> |
|
272 Private slot to read all available serial data and emit it with the |
|
273 "dataReceived" signal for further processing. |
|
274 </p> |
|
275 <a NAME="MicroPythonCommandsInterface.__shortError" ID="MicroPythonCommandsInterface.__shortError"></a> |
|
276 <h4>MicroPythonCommandsInterface.__shortError</h4> |
|
277 <b>__shortError</b>(<i>error</i>) |
|
278 |
|
279 <p> |
|
280 Private method to create a shortened error message. |
|
281 </p> |
|
282 <dl> |
|
283 |
|
284 <dt><i>error</i> (bytes)</dt> |
|
285 <dd> |
|
286 verbose error message |
|
287 </dd> |
|
288 </dl> |
|
289 <dl> |
|
290 <dt>Return:</dt> |
|
291 <dd> |
|
292 shortened error message |
|
293 </dd> |
|
294 </dl> |
|
295 <dl> |
|
296 <dt>Return Type:</dt> |
|
297 <dd> |
|
298 str |
|
299 </dd> |
|
300 </dl> |
|
301 <a NAME="MicroPythonCommandsInterface.cd" ID="MicroPythonCommandsInterface.cd"></a> |
|
302 <h4>MicroPythonCommandsInterface.cd</h4> |
|
303 <b>cd</b>(<i>dirname</i>) |
|
304 |
|
305 <p> |
|
306 Public method to change the current directory on the connected device. |
|
307 </p> |
|
308 <dl> |
|
309 |
|
310 <dt><i>dirname</i> (str)</dt> |
|
311 <dd> |
|
312 directory to change to |
|
313 </dd> |
|
314 </dl> |
|
315 <dl> |
|
316 |
|
317 <dt>Raises <b>OSError</b>:</dt> |
|
318 <dd> |
|
319 raised to indicate an issue with the device |
|
320 </dd> |
|
321 </dl> |
|
322 <a NAME="MicroPythonCommandsInterface.connectToDevice" ID="MicroPythonCommandsInterface.connectToDevice"></a> |
|
323 <h4>MicroPythonCommandsInterface.connectToDevice</h4> |
|
324 <b>connectToDevice</b>(<i>port</i>) |
|
325 |
|
326 <p> |
|
327 Public slot to start the manager. |
|
328 </p> |
|
329 <dl> |
|
330 |
|
331 <dt><i>port</i> (str)</dt> |
|
332 <dd> |
|
333 name of the port to be used |
|
334 </dd> |
|
335 </dl> |
|
336 <dl> |
|
337 <dt>Return:</dt> |
|
338 <dd> |
|
339 flag indicating success |
|
340 </dd> |
|
341 </dl> |
|
342 <dl> |
|
343 <dt>Return Type:</dt> |
|
344 <dd> |
|
345 bool |
|
346 </dd> |
|
347 </dl> |
|
348 <a NAME="MicroPythonCommandsInterface.disconnectFromDevice" ID="MicroPythonCommandsInterface.disconnectFromDevice"></a> |
|
349 <h4>MicroPythonCommandsInterface.disconnectFromDevice</h4> |
|
350 <b>disconnectFromDevice</b>(<i></i>) |
|
351 |
|
352 <p> |
|
353 Public slot to stop the thread. |
|
354 </p> |
|
355 <a NAME="MicroPythonCommandsInterface.execute" ID="MicroPythonCommandsInterface.execute"></a> |
|
356 <h4>MicroPythonCommandsInterface.execute</h4> |
|
357 <b>execute</b>(<i>commands</i>) |
|
358 |
|
359 <p> |
|
360 Public method to send commands to the connected device and return the |
|
361 result. |
|
362 </p> |
|
363 <p> |
|
364 If no serial connection is available, empty results will be returned. |
|
365 </p> |
|
366 <dl> |
|
367 |
|
368 <dt><i>commands</i> (str)</dt> |
|
369 <dd> |
|
370 list of commands to be executed |
|
371 </dd> |
|
372 </dl> |
|
373 <dl> |
|
374 <dt>Return:</dt> |
|
375 <dd> |
|
376 tuple containing stdout and stderr output of the device |
|
377 </dd> |
|
378 </dl> |
|
379 <dl> |
|
380 <dt>Return Type:</dt> |
|
381 <dd> |
|
382 tuple of (bytes, bytes) |
|
383 </dd> |
|
384 </dl> |
|
385 <a NAME="MicroPythonCommandsInterface.executeAsync" ID="MicroPythonCommandsInterface.executeAsync"></a> |
|
386 <h4>MicroPythonCommandsInterface.executeAsync</h4> |
|
387 <b>executeAsync</b>(<i>commandsList</i>) |
|
388 |
|
389 <p> |
|
390 Public method to execute a series of commands over a period of time |
|
391 without returning any result (asynchronous execution). |
|
392 </p> |
|
393 <dl> |
|
394 |
|
395 <dt><i>commandsList</i> (list of bytes)</dt> |
|
396 <dd> |
|
397 list of commands to be execute on the device |
|
398 </dd> |
|
399 </dl> |
|
400 <a NAME="MicroPythonCommandsInterface.fileSystemInfo" ID="MicroPythonCommandsInterface.fileSystemInfo"></a> |
|
401 <h4>MicroPythonCommandsInterface.fileSystemInfo</h4> |
|
402 <b>fileSystemInfo</b>(<i></i>) |
|
403 |
|
404 <p> |
|
405 Public method to obtain information about the currently mounted file |
|
406 systems. |
|
407 </p> |
|
408 <dl> |
|
409 <dt>Return:</dt> |
|
410 <dd> |
|
411 tuple of tuples containing the file system name, the total |
|
412 size, the used size and the free size |
|
413 </dd> |
|
414 </dl> |
|
415 <dl> |
|
416 <dt>Return Type:</dt> |
|
417 <dd> |
|
418 tuple of tuples of (str, int, int, int) |
|
419 </dd> |
|
420 </dl> |
|
421 <dl> |
|
422 |
|
423 <dt>Raises <b>OSError</b>:</dt> |
|
424 <dd> |
|
425 raised to indicate an issue with the device |
|
426 </dd> |
|
427 </dl> |
|
428 <a NAME="MicroPythonCommandsInterface.get" ID="MicroPythonCommandsInterface.get"></a> |
|
429 <h4>MicroPythonCommandsInterface.get</h4> |
|
430 <b>get</b>(<i>deviceFileName, hostFileName=None</i>) |
|
431 |
|
432 <p> |
|
433 Public method to copy a file from the connected device. |
|
434 </p> |
|
435 <dl> |
|
436 |
|
437 <dt><i>deviceFileName</i> (str)</dt> |
|
438 <dd> |
|
439 name of the file to copy |
|
440 </dd> |
|
441 <dt><i>hostFileName</i> (str)</dt> |
|
442 <dd> |
|
443 name of the file to copy to |
|
444 </dd> |
|
445 </dl> |
|
446 <dl> |
|
447 <dt>Return:</dt> |
|
448 <dd> |
|
449 flag indicating success |
|
450 </dd> |
|
451 </dl> |
|
452 <dl> |
|
453 <dt>Return Type:</dt> |
|
454 <dd> |
|
455 bool |
|
456 </dd> |
|
457 </dl> |
|
458 <dl> |
|
459 |
|
460 <dt>Raises <b>OSError</b>:</dt> |
|
461 <dd> |
|
462 raised to indicate an issue with the device |
|
463 </dd> |
|
464 </dl> |
|
465 <a NAME="MicroPythonCommandsInterface.getImplementation" ID="MicroPythonCommandsInterface.getImplementation"></a> |
|
466 <h4>MicroPythonCommandsInterface.getImplementation</h4> |
|
467 <b>getImplementation</b>(<i></i>) |
|
468 |
|
469 <p> |
|
470 Public method to get some implementation information of the connected |
|
471 device. |
|
472 </p> |
|
473 <dl> |
|
474 <dt>Return:</dt> |
|
475 <dd> |
|
476 dictionary containing the implementation information |
|
477 </dd> |
|
478 </dl> |
|
479 <dl> |
|
480 <dt>Return Type:</dt> |
|
481 <dd> |
|
482 dict |
|
483 </dd> |
|
484 </dl> |
|
485 <dl> |
|
486 |
|
487 <dt>Raises <b>OSError</b>:</dt> |
|
488 <dd> |
|
489 raised to indicate an issue with the device |
|
490 </dd> |
|
491 </dl> |
|
492 <a NAME="MicroPythonCommandsInterface.getTime" ID="MicroPythonCommandsInterface.getTime"></a> |
|
493 <h4>MicroPythonCommandsInterface.getTime</h4> |
|
494 <b>getTime</b>(<i></i>) |
|
495 |
|
496 <p> |
|
497 Public method to get the current time of the device. |
|
498 </p> |
|
499 <dl> |
|
500 <dt>Return:</dt> |
|
501 <dd> |
|
502 time of the device |
|
503 </dd> |
|
504 </dl> |
|
505 <dl> |
|
506 <dt>Return Type:</dt> |
|
507 <dd> |
|
508 str |
|
509 </dd> |
|
510 </dl> |
|
511 <dl> |
|
512 |
|
513 <dt>Raises <b>OSError</b>:</dt> |
|
514 <dd> |
|
515 raised to indicate an issue with the device |
|
516 </dd> |
|
517 </dl> |
|
518 <a NAME="MicroPythonCommandsInterface.handlePreferencesChanged" ID="MicroPythonCommandsInterface.handlePreferencesChanged"></a> |
|
519 <h4>MicroPythonCommandsInterface.handlePreferencesChanged</h4> |
|
520 <b>handlePreferencesChanged</b>(<i></i>) |
|
521 |
|
522 <p> |
|
523 Public slot to handle a change of the preferences. |
|
524 </p> |
|
525 <a NAME="MicroPythonCommandsInterface.isConnected" ID="MicroPythonCommandsInterface.isConnected"></a> |
|
526 <h4>MicroPythonCommandsInterface.isConnected</h4> |
|
527 <b>isConnected</b>(<i></i>) |
|
528 |
|
529 <p> |
|
530 Public method to get the connection status. |
|
531 </p> |
|
532 <dl> |
|
533 <dt>Return:</dt> |
|
534 <dd> |
|
535 flag indicating the connection status |
|
536 </dd> |
|
537 </dl> |
|
538 <dl> |
|
539 <dt>Return Type:</dt> |
|
540 <dd> |
|
541 bool |
|
542 </dd> |
|
543 </dl> |
|
544 <a NAME="MicroPythonCommandsInterface.lls" ID="MicroPythonCommandsInterface.lls"></a> |
|
545 <h4>MicroPythonCommandsInterface.lls</h4> |
|
546 <b>lls</b>(<i>dirname="", fullstat=False, showHidden=False</i>) |
|
547 |
|
548 <p> |
|
549 Public method to get a long directory listing of the connected device |
|
550 including meta data. |
|
551 </p> |
|
552 <dl> |
|
553 |
|
554 <dt><i>dirname</i> (str)</dt> |
|
555 <dd> |
|
556 name of the directory to be listed |
|
557 </dd> |
|
558 <dt><i>fullstat</i> (bool)</dt> |
|
559 <dd> |
|
560 flag indicating to return the full stat() tuple |
|
561 </dd> |
|
562 <dt><i>showHidden</i> (bool)</dt> |
|
563 <dd> |
|
564 flag indicating to show hidden files as well |
|
565 </dd> |
|
566 </dl> |
|
567 <dl> |
|
568 <dt>Return:</dt> |
|
569 <dd> |
|
570 list containing the directory listing with tuple entries of |
|
571 the name and and a tuple of mode, size and time (if fullstat is |
|
572 false) or the complete stat() tuple. 'None' is returned in case the |
|
573 directory doesn't exist. |
|
574 </dd> |
|
575 </dl> |
|
576 <dl> |
|
577 <dt>Return Type:</dt> |
|
578 <dd> |
|
579 tuple of (str, tuple) |
|
580 </dd> |
|
581 </dl> |
|
582 <dl> |
|
583 |
|
584 <dt>Raises <b>OSError</b>:</dt> |
|
585 <dd> |
|
586 raised to indicate an issue with the device |
|
587 </dd> |
|
588 </dl> |
|
589 <a NAME="MicroPythonCommandsInterface.ls" ID="MicroPythonCommandsInterface.ls"></a> |
|
590 <h4>MicroPythonCommandsInterface.ls</h4> |
|
591 <b>ls</b>(<i>dirname=""</i>) |
|
592 |
|
593 <p> |
|
594 Public method to get a directory listing of the connected device. |
|
595 </p> |
|
596 <dl> |
|
597 |
|
598 <dt><i>dirname</i> (str)</dt> |
|
599 <dd> |
|
600 name of the directory to be listed |
|
601 </dd> |
|
602 </dl> |
|
603 <dl> |
|
604 <dt>Return:</dt> |
|
605 <dd> |
|
606 tuple containg the directory listing |
|
607 </dd> |
|
608 </dl> |
|
609 <dl> |
|
610 <dt>Return Type:</dt> |
|
611 <dd> |
|
612 tuple of str |
|
613 </dd> |
|
614 </dl> |
|
615 <dl> |
|
616 |
|
617 <dt>Raises <b>OSError</b>:</dt> |
|
618 <dd> |
|
619 raised to indicate an issue with the device |
|
620 </dd> |
|
621 </dl> |
|
622 <a NAME="MicroPythonCommandsInterface.mkdir" ID="MicroPythonCommandsInterface.mkdir"></a> |
|
623 <h4>MicroPythonCommandsInterface.mkdir</h4> |
|
624 <b>mkdir</b>(<i>dirname</i>) |
|
625 |
|
626 <p> |
|
627 Public method to create a new directory. |
|
628 </p> |
|
629 <dl> |
|
630 |
|
631 <dt><i>dirname</i> (str)</dt> |
|
632 <dd> |
|
633 name of the directory to create |
|
634 </dd> |
|
635 </dl> |
|
636 <dl> |
|
637 |
|
638 <dt>Raises <b>OSError</b>:</dt> |
|
639 <dd> |
|
640 raised to indicate an issue with the device |
|
641 </dd> |
|
642 </dl> |
|
643 <a NAME="MicroPythonCommandsInterface.put" ID="MicroPythonCommandsInterface.put"></a> |
|
644 <h4>MicroPythonCommandsInterface.put</h4> |
|
645 <b>put</b>(<i>hostFileName, deviceFileName=None</i>) |
|
646 |
|
647 <p> |
|
648 Public method to copy a local file to the connected device. |
|
649 </p> |
|
650 <dl> |
|
651 |
|
652 <dt><i>hostFileName</i> (str)</dt> |
|
653 <dd> |
|
654 name of the file to be copied |
|
655 </dd> |
|
656 <dt><i>deviceFileName</i> (str)</dt> |
|
657 <dd> |
|
658 name of the file to copy to |
|
659 </dd> |
|
660 </dl> |
|
661 <dl> |
|
662 <dt>Return:</dt> |
|
663 <dd> |
|
664 flag indicating success |
|
665 </dd> |
|
666 </dl> |
|
667 <dl> |
|
668 <dt>Return Type:</dt> |
|
669 <dd> |
|
670 bool |
|
671 </dd> |
|
672 </dl> |
|
673 <dl> |
|
674 |
|
675 <dt>Raises <b>OSError</b>:</dt> |
|
676 <dd> |
|
677 raised to indicate an issue with the device |
|
678 </dd> |
|
679 </dl> |
|
680 <a NAME="MicroPythonCommandsInterface.pwd" ID="MicroPythonCommandsInterface.pwd"></a> |
|
681 <h4>MicroPythonCommandsInterface.pwd</h4> |
|
682 <b>pwd</b>(<i></i>) |
|
683 |
|
684 <p> |
|
685 Public method to get the current directory of the connected device. |
|
686 </p> |
|
687 <dl> |
|
688 <dt>Return:</dt> |
|
689 <dd> |
|
690 current directory |
|
691 </dd> |
|
692 </dl> |
|
693 <dl> |
|
694 <dt>Return Type:</dt> |
|
695 <dd> |
|
696 str |
|
697 </dd> |
|
698 </dl> |
|
699 <dl> |
|
700 |
|
701 <dt>Raises <b>OSError</b>:</dt> |
|
702 <dd> |
|
703 raised to indicate an issue with the device |
|
704 </dd> |
|
705 </dl> |
|
706 <a NAME="MicroPythonCommandsInterface.remainingTask" ID="MicroPythonCommandsInterface.remainingTask"></a> |
|
707 <h4>MicroPythonCommandsInterface.remainingTask</h4> |
|
708 <b>remainingTask</b>(<i></i>) |
|
709 |
|
710 <a NAME="MicroPythonCommandsInterface.rm" ID="MicroPythonCommandsInterface.rm"></a> |
|
711 <h4>MicroPythonCommandsInterface.rm</h4> |
|
712 <b>rm</b>(<i>filename</i>) |
|
713 |
|
714 <p> |
|
715 Public method to remove a file from the connected device. |
|
716 </p> |
|
717 <dl> |
|
718 |
|
719 <dt><i>filename</i> (str)</dt> |
|
720 <dd> |
|
721 name of the file to be removed |
|
722 </dd> |
|
723 </dl> |
|
724 <dl> |
|
725 |
|
726 <dt>Raises <b>OSError</b>:</dt> |
|
727 <dd> |
|
728 raised to indicate an issue with the device |
|
729 </dd> |
|
730 </dl> |
|
731 <a NAME="MicroPythonCommandsInterface.rmdir" ID="MicroPythonCommandsInterface.rmdir"></a> |
|
732 <h4>MicroPythonCommandsInterface.rmdir</h4> |
|
733 <b>rmdir</b>(<i>dirname</i>) |
|
734 |
|
735 <p> |
|
736 Public method to remove a directory. |
|
737 </p> |
|
738 <dl> |
|
739 |
|
740 <dt><i>dirname</i> (str)</dt> |
|
741 <dd> |
|
742 name of the directory to be removed |
|
743 </dd> |
|
744 </dl> |
|
745 <dl> |
|
746 |
|
747 <dt>Raises <b>OSError</b>:</dt> |
|
748 <dd> |
|
749 raised to indicate an issue with the device |
|
750 </dd> |
|
751 </dl> |
|
752 <a NAME="MicroPythonCommandsInterface.rmrf" ID="MicroPythonCommandsInterface.rmrf"></a> |
|
753 <h4>MicroPythonCommandsInterface.rmrf</h4> |
|
754 <b>rmrf</b>(<i>name, recursive=False, force=False</i>) |
|
755 |
|
756 <p> |
|
757 Public method to remove a file or directory recursively. |
|
758 </p> |
|
759 <dl> |
|
760 |
|
761 <dt><i>name</i> (str)</dt> |
|
762 <dd> |
|
763 of the file or directory to remove |
|
764 </dd> |
|
765 <dt><i>recursive</i> (bool)</dt> |
|
766 <dd> |
|
767 flag indicating a recursive deletion |
|
768 </dd> |
|
769 <dt><i>force</i> (bool)</dt> |
|
770 <dd> |
|
771 flag indicating to ignore errors |
|
772 </dd> |
|
773 </dl> |
|
774 <dl> |
|
775 <dt>Return:</dt> |
|
776 <dd> |
|
777 flag indicating success |
|
778 </dd> |
|
779 </dl> |
|
780 <dl> |
|
781 <dt>Return Type:</dt> |
|
782 <dd> |
|
783 bool |
|
784 </dd> |
|
785 </dl> |
|
786 <dl> |
|
787 |
|
788 <dt>Raises <b>OSError</b>:</dt> |
|
789 <dd> |
|
790 raised to indicate an issue with the device |
|
791 </dd> |
|
792 </dl> |
|
793 <a NAME="MicroPythonCommandsInterface.syncTime" ID="MicroPythonCommandsInterface.syncTime"></a> |
|
794 <h4>MicroPythonCommandsInterface.syncTime</h4> |
|
795 <b>syncTime</b>(<i>deviceType</i>) |
|
796 |
|
797 <p> |
|
798 Public method to set the time of the connected device to the local |
|
799 computer's time. |
|
800 </p> |
|
801 <dl> |
|
802 |
|
803 <dt><i>deviceType</i> (str)</dt> |
|
804 <dd> |
|
805 type of board to sync time to |
|
806 </dd> |
|
807 </dl> |
|
808 <dl> |
|
809 |
|
810 <dt>Raises <b>OSError</b>:</dt> |
|
811 <dd> |
|
812 raised to indicate an issue with the device |
|
813 </dd> |
|
814 </dl> |
|
815 <a NAME="MicroPythonCommandsInterface.version" ID="MicroPythonCommandsInterface.version"></a> |
|
816 <h4>MicroPythonCommandsInterface.version</h4> |
|
817 <b>version</b>(<i></i>) |
|
818 |
|
819 <p> |
|
820 Public method to get the MicroPython version information of the |
|
821 connected device. |
|
822 </p> |
|
823 <dl> |
|
824 <dt>Return:</dt> |
|
825 <dd> |
|
826 dictionary containing the version information |
|
827 </dd> |
|
828 </dl> |
|
829 <dl> |
|
830 <dt>Return Type:</dt> |
|
831 <dd> |
|
832 dict |
|
833 </dd> |
|
834 </dl> |
|
835 <dl> |
|
836 |
|
837 <dt>Raises <b>OSError</b>:</dt> |
|
838 <dd> |
|
839 raised to indicate an issue with the device |
|
840 </dd> |
|
841 </dl> |
|
842 <a NAME="MicroPythonCommandsInterface.write" ID="MicroPythonCommandsInterface.write"></a> |
|
843 <h4>MicroPythonCommandsInterface.write</h4> |
|
844 <b>write</b>(<i>data</i>) |
|
845 |
|
846 <p> |
|
847 Public method to write data to the connected device. |
|
848 </p> |
|
849 <dl> |
|
850 |
|
851 <dt><i>data</i> (bytes or bytearray)</dt> |
|
852 <dd> |
|
853 data to be written |
|
854 </dd> |
|
855 </dl> |
|
856 <div align="right"><a href="#top">Up</a></div> |
|
857 <hr /> |
|
858 </body></html> |