src/eric7/Documentation/Source/eric7.MicroPython.Devices.DeviceBase.html

branch
eric7
changeset 9765
6378da868bb0
parent 9756
9854647c8c5c
child 9766
f0e22f3a5878
diff -r 57496966803c -r 6378da868bb0 src/eric7/Documentation/Source/eric7.MicroPython.Devices.DeviceBase.html
--- a/src/eric7/Documentation/Source/eric7.MicroPython.Devices.DeviceBase.html	Tue Feb 14 11:09:49 2023 +0100
+++ b/src/eric7/Documentation/Source/eric7.MicroPython.Devices.DeviceBase.html	Tue Feb 14 18:10:30 2023 +0100
@@ -60,6 +60,18 @@
 <td>Constructor</td>
 </tr>
 <tr>
+<td><a href="#BaseDevice.__getDeviceData">__getDeviceData</a></td>
+<td>Private method to get some essential data for the connected board.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice._getSetTimeCode">_getSetTimeCode</a></td>
+<td>Protected method to get the device code to set the time.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice._shortError">_shortError</a></td>
+<td>Protected method to create a shortened error message.</td>
+</tr>
+<tr>
 <td><a href="#BaseDevice.addDeviceMenuEntries">addDeviceMenuEntries</a></td>
 <td>Public method to add device specific entries to the given menu.</td>
 </tr>
@@ -80,6 +92,10 @@
 <td>Public method to determine, if a REPL can be started.</td>
 </tr>
 <tr>
+<td><a href="#BaseDevice.cd">cd</a></td>
+<td>Public method to change the current directory on the connected device.</td>
+</tr>
+<tr>
 <td><a href="#BaseDevice.checkDeviceData">checkDeviceData</a></td>
 <td>Public method to check the validity of the device data determined during connecting the device.</td>
 </tr>
@@ -92,10 +108,26 @@
 <td>Public method to download the device firmware.</td>
 </tr>
 <tr>
+<td><a href="#BaseDevice.fileSystemInfo">fileSystemInfo</a></td>
+<td>Public method to obtain information about the currently mounted file systems.</td>
+</tr>
+<tr>
 <td><a href="#BaseDevice.forceInterrupt">forceInterrupt</a></td>
 <td>Public method to determine the need for an interrupt when opening the serial connection.</td>
 </tr>
 <tr>
+<td><a href="#BaseDevice.get">get</a></td>
+<td>Public method to copy a file from the connected device.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice.getBoardInformation">getBoardInformation</a></td>
+<td>Public method to get some information data of the connected board.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice.getData">getData</a></td>
+<td>Public method to read data from the connected device.</td>
+</tr>
+<tr>
 <td><a href="#BaseDevice.getDeviceData">getDeviceData</a></td>
 <td>Public method to get a copy of the determined device data.</td>
 </tr>
@@ -116,6 +148,14 @@
 <td>Public method to get the device firmware download URL.</td>
 </tr>
 <tr>
+<td><a href="#BaseDevice.getModules">getModules</a></td>
+<td>Public method to show a list of modules built into the firmware.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice.getTime">getTime</a></td>
+<td>Public method to get the current time of the device.</td>
+</tr>
+<tr>
 <td><a href="#BaseDevice.getWorkspace">getWorkspace</a></td>
 <td>Public method to get the workspace directory.</td>
 </tr>
@@ -124,6 +164,10 @@
 <td>Public slot handling a data floof from the device.</td>
 </tr>
 <tr>
+<td><a href="#BaseDevice.hasCircuitPython">hasCircuitPython</a></td>
+<td>Public method to check, if the connected device is flashed with CircuitPython.</td>
+</tr>
+<tr>
 <td><a href="#BaseDevice.hasDocumentationUrl">hasDocumentationUrl</a></td>
 <td>Public method to check, if the device has a configured documentation URL.</td>
 </tr>
@@ -140,6 +184,42 @@
 <td>Public method to check, if the device supports time commands.</td>
 </tr>
 <tr>
+<td><a href="#BaseDevice.lls">lls</a></td>
+<td>Public method to get a long directory listing of the connected device including meta data.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice.ls">ls</a></td>
+<td>Public method to get a directory listing of the connected device.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice.mkdir">mkdir</a></td>
+<td>Public method to create a new directory.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice.put">put</a></td>
+<td>Public method to copy a local file to the connected device.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice.putData">putData</a></td>
+<td>Public method to write the given data to the connected device.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice.pwd">pwd</a></td>
+<td>Public method to get the current directory of the connected device.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice.rm">rm</a></td>
+<td>Public method to remove a file from the connected device.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice.rmdir">rmdir</a></td>
+<td>Public method to remove a directory.</td>
+</tr>
+<tr>
+<td><a href="#BaseDevice.rmrf">rmrf</a></td>
+<td>Public method to remove a file or directory recursively.</td>
+</tr>
+<tr>
 <td><a href="#BaseDevice.runScript">runScript</a></td>
 <td>Public method to run the given Python script.</td>
 </tr>
@@ -175,6 +255,10 @@
 <td><a href="#BaseDevice.supportsLocalFileAccess">supportsLocalFileAccess</a></td>
 <td>Public method to indicate file access via a local directory.</td>
 </tr>
+<tr>
+<td><a href="#BaseDevice.syncTime">syncTime</a></td>
+<td>Public method to set the time of the connected device to the local computer's time.</td>
+</tr>
 </table>
 <h3>Static Methods</h3>
 
@@ -204,6 +288,81 @@
 reference to the parent object
 </dd>
 </dl>
+<a NAME="BaseDevice.__getDeviceData" ID="BaseDevice.__getDeviceData"></a>
+<h4>BaseDevice.__getDeviceData</h4>
+<b>__getDeviceData</b>(<i></i>)
+
+<p>
+        Private method to get some essential data for the connected board.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+dictionary containing the determined data
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+dict
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice._getSetTimeCode" ID="BaseDevice._getSetTimeCode"></a>
+<h4>BaseDevice._getSetTimeCode</h4>
+<b>_getSetTimeCode</b>(<i></i>)
+
+<p>
+        Protected method to get the device code to set the time.
+</p>
+<p>
+        Note: This method must be implemented in the various device specific
+        subclasses.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+code to be executed on the connected device to set the time
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+str
+</dd>
+</dl>
+<a NAME="BaseDevice._shortError" ID="BaseDevice._shortError"></a>
+<h4>BaseDevice._shortError</h4>
+<b>_shortError</b>(<i>error</i>)
+
+<p>
+        Protected method to create a shortened error message.
+</p>
+<dl>
+
+<dt><i>error</i> (bytes)</dt>
+<dd>
+verbose error message
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+shortened error message
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+str
+</dd>
+</dl>
 <a NAME="BaseDevice.addDeviceMenuEntries" ID="BaseDevice.addDeviceMenuEntries"></a>
 <h4>BaseDevice.addDeviceMenuEntries</h4>
 <b>addDeviceMenuEntries</b>(<i>menu</i>)
@@ -298,6 +457,27 @@
 tuple of (bool, str)
 </dd>
 </dl>
+<a NAME="BaseDevice.cd" ID="BaseDevice.cd"></a>
+<h4>BaseDevice.cd</h4>
+<b>cd</b>(<i>dirname</i>)
+
+<p>
+        Public method to change the current directory on the connected device.
+</p>
+<dl>
+
+<dt><i>dirname</i> (str)</dt>
+<dd>
+directory to change to
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
 <a NAME="BaseDevice.checkDeviceData" ID="BaseDevice.checkDeviceData"></a>
 <h4>BaseDevice.checkDeviceData</h4>
 <b>checkDeviceData</b>(<i></i>)
@@ -344,6 +524,34 @@
 <p>
         Public method to download the device firmware.
 </p>
+<a NAME="BaseDevice.fileSystemInfo" ID="BaseDevice.fileSystemInfo"></a>
+<h4>BaseDevice.fileSystemInfo</h4>
+<b>fileSystemInfo</b>(<i></i>)
+
+<p>
+        Public method to obtain information about the currently mounted file
+        systems.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple of tuples containing the file system name, the total
+            size, the used size and the free size
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of tuples of (str, int, int, int)
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
 <a NAME="BaseDevice.forceInterrupt" ID="BaseDevice.forceInterrupt"></a>
 <h4>BaseDevice.forceInterrupt</h4>
 <b>forceInterrupt</b>(<i></i>)
@@ -364,6 +572,102 @@
 bool
 </dd>
 </dl>
+<a NAME="BaseDevice.get" ID="BaseDevice.get"></a>
+<h4>BaseDevice.get</h4>
+<b>get</b>(<i>deviceFileName, hostFileName=None</i>)
+
+<p>
+        Public method to copy a file from the connected device.
+</p>
+<dl>
+
+<dt><i>deviceFileName</i> (str)</dt>
+<dd>
+name of the file to copy
+</dd>
+<dt><i>hostFileName</i> (str)</dt>
+<dd>
+name of the file to copy to
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+flag indicating success
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice.getBoardInformation" ID="BaseDevice.getBoardInformation"></a>
+<h4>BaseDevice.getBoardInformation</h4>
+<b>getBoardInformation</b>(<i></i>)
+
+<p>
+        Public method to get some information data of the connected board.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+dictionary containing the determined data
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+dict
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice.getData" ID="BaseDevice.getData"></a>
+<h4>BaseDevice.getData</h4>
+<b>getData</b>(<i>deviceFileName</i>)
+
+<p>
+        Public method to read data from the connected device.
+</p>
+<dl>
+
+<dt><i>deviceFileName</i> (str)</dt>
+<dd>
+name of the file to read from
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+data read from the device
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bytes
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
 <a NAME="BaseDevice.getDeviceData" ID="BaseDevice.getDeviceData"></a>
 <h4>BaseDevice.getDeviceData</h4>
 <b>getDeviceData</b>(<i></i>)
@@ -460,6 +764,58 @@
 str
 </dd>
 </dl>
+<a NAME="BaseDevice.getModules" ID="BaseDevice.getModules"></a>
+<h4>BaseDevice.getModules</h4>
+<b>getModules</b>(<i></i>)
+
+<p>
+        Public method to show a list of modules built into the firmware.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+list of builtin modules
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+list of str
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice.getTime" ID="BaseDevice.getTime"></a>
+<h4>BaseDevice.getTime</h4>
+<b>getTime</b>(<i></i>)
+
+<p>
+        Public method to get the current time of the device.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+time of the device
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+str
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
 <a NAME="BaseDevice.getWorkspace" ID="BaseDevice.getWorkspace"></a>
 <h4>BaseDevice.getWorkspace</h4>
 <b>getWorkspace</b>(<i></i>)
@@ -486,6 +842,25 @@
 <p>
         Public slot handling a data floof from the device.
 </p>
+<a NAME="BaseDevice.hasCircuitPython" ID="BaseDevice.hasCircuitPython"></a>
+<h4>BaseDevice.hasCircuitPython</h4>
+<b>hasCircuitPython</b>(<i></i>)
+
+<p>
+        Public method to check, if the connected device is flashed with CircuitPython.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+flag indicating CircuitPython
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl>
 <a NAME="BaseDevice.hasDocumentationUrl" ID="BaseDevice.hasDocumentationUrl"></a>
 <h4>BaseDevice.hasDocumentationUrl</h4>
 <b>hasDocumentationUrl</b>(<i></i>)
@@ -567,6 +942,288 @@
 bool
 </dd>
 </dl>
+<a NAME="BaseDevice.lls" ID="BaseDevice.lls"></a>
+<h4>BaseDevice.lls</h4>
+<b>lls</b>(<i>dirname="", fullstat=False, showHidden=False</i>)
+
+<p>
+        Public method to get a long directory listing of the connected device
+        including meta data.
+</p>
+<dl>
+
+<dt><i>dirname</i> (str)</dt>
+<dd>
+name of the directory to be listed
+</dd>
+<dt><i>fullstat</i> (bool)</dt>
+<dd>
+flag indicating to return the full stat() tuple
+</dd>
+<dt><i>showHidden</i> (bool)</dt>
+<dd>
+flag indicating to show hidden files as well
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+list containing the directory listing with tuple entries of
+            the name and and a tuple of mode, size and time (if fullstat is
+            false) or the complete stat() tuple. 'None' is returned in case the
+            directory doesn't exist.
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of (str, tuple)
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice.ls" ID="BaseDevice.ls"></a>
+<h4>BaseDevice.ls</h4>
+<b>ls</b>(<i>dirname=""</i>)
+
+<p>
+        Public method to get a directory listing of the connected device.
+</p>
+<dl>
+
+<dt><i>dirname</i> (str)</dt>
+<dd>
+name of the directory to be listed
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+tuple containg the directory listing
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+tuple of str
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice.mkdir" ID="BaseDevice.mkdir"></a>
+<h4>BaseDevice.mkdir</h4>
+<b>mkdir</b>(<i>dirname</i>)
+
+<p>
+        Public method to create a new directory.
+</p>
+<dl>
+
+<dt><i>dirname</i> (str)</dt>
+<dd>
+name of the directory to create
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice.put" ID="BaseDevice.put"></a>
+<h4>BaseDevice.put</h4>
+<b>put</b>(<i>hostFileName, deviceFileName=None</i>)
+
+<p>
+        Public method to copy a local file to the connected device.
+</p>
+<dl>
+
+<dt><i>hostFileName</i> (str)</dt>
+<dd>
+name of the file to be copied
+</dd>
+<dt><i>deviceFileName</i> (str)</dt>
+<dd>
+name of the file to copy to
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+flag indicating success
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice.putData" ID="BaseDevice.putData"></a>
+<h4>BaseDevice.putData</h4>
+<b>putData</b>(<i>deviceFileName, content</i>)
+
+<p>
+        Public method to write the given data to the connected device.
+</p>
+<dl>
+
+<dt><i>deviceFileName</i> (str)</dt>
+<dd>
+name of the file to write to
+</dd>
+<dt><i>content</i> (bytes)</dt>
+<dd>
+data to write
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+flag indicating success
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice.pwd" ID="BaseDevice.pwd"></a>
+<h4>BaseDevice.pwd</h4>
+<b>pwd</b>(<i></i>)
+
+<p>
+        Public method to get the current directory of the connected device.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+current directory
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+str
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice.rm" ID="BaseDevice.rm"></a>
+<h4>BaseDevice.rm</h4>
+<b>rm</b>(<i>filename</i>)
+
+<p>
+        Public method to remove a file from the connected device.
+</p>
+<dl>
+
+<dt><i>filename</i> (str)</dt>
+<dd>
+name of the file to be removed
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice.rmdir" ID="BaseDevice.rmdir"></a>
+<h4>BaseDevice.rmdir</h4>
+<b>rmdir</b>(<i>dirname</i>)
+
+<p>
+        Public method to remove a directory.
+</p>
+<dl>
+
+<dt><i>dirname</i> (str)</dt>
+<dd>
+name of the directory to be removed
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
+<a NAME="BaseDevice.rmrf" ID="BaseDevice.rmrf"></a>
+<h4>BaseDevice.rmrf</h4>
+<b>rmrf</b>(<i>name, recursive=False, force=False</i>)
+
+<p>
+        Public method to remove a file or directory recursively.
+</p>
+<dl>
+
+<dt><i>name</i> (str)</dt>
+<dd>
+of the file or directory to remove
+</dd>
+<dt><i>recursive</i> (bool)</dt>
+<dd>
+flag indicating a recursive deletion
+</dd>
+<dt><i>force</i> (bool)</dt>
+<dd>
+flag indicating to ignore errors
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+flag indicating success
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
 <a NAME="BaseDevice.runScript" ID="BaseDevice.runScript"></a>
 <h4>BaseDevice.runScript</h4>
 <b>runScript</b>(<i>script</i>)
@@ -708,6 +1365,33 @@
 bool
 </dd>
 </dl>
+<a NAME="BaseDevice.syncTime" ID="BaseDevice.syncTime"></a>
+<h4>BaseDevice.syncTime</h4>
+<b>syncTime</b>(<i>deviceType, hasCPy=False</i>)
+
+<p>
+        Public method to set the time of the connected device to the local
+        computer's time.
+</p>
+<dl>
+
+<dt><i>deviceType</i> (str)</dt>
+<dd>
+type of board to sync time to
+</dd>
+<dt><i>hasCPy</i> (bool)</dt>
+<dd>
+flag indicating that the device has CircuitPython loadede
+            (defaults to False)
+</dd>
+</dl>
+<dl>
+
+<dt>Raises <b>OSError</b>:</dt>
+<dd>
+raised to indicate an issue with the device
+</dd>
+</dl>
 <div align="right"><a href="#top">Up</a></div>
 <hr />
 </body></html>
\ No newline at end of file

eric ide

mercurial