Fri, 25 Apr 2025 16:23:02 +0200
MicroPython
- Extended the handling of Access Point security/authmode settings to be more dynamic.
<!DOCTYPE html> <html><head> <title>eric7.MicroPython.MicroPythonWidget</title> <meta charset="UTF-8"> <link rel="stylesheet" href="styles.css"> </head> <body> <a NAME="top" ID="top"></a> <h1>eric7.MicroPython.MicroPythonWidget</h1> <p> Module implementing the MicroPython REPL widget. </p> <h3>Global Attributes</h3> <table> <tr><td>HAS_QTCHART</td></tr> <tr><td>HAS_QTSERIALPORT</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#MicroPythonWidget">MicroPythonWidget</a></td> <td>Class implementing the MicroPython REPL widget.</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /> <hr /> <a NAME="MicroPythonWidget" ID="MicroPythonWidget"></a> <h2>MicroPythonWidget</h2> <p> Class implementing the MicroPython REPL widget. </p> <h3>Signals</h3> <dl> <dt>aboutToDisconnect()</dt> <dd> emitted to indicate the imminent disconnect from the currently device </dd> <dt>dataReceived(data)</dt> <dd> emitted to send data received via the serial connection for further processing </dd> <dt>disconnected()</dt> <dd> emitted after the device was disconnected </dd> </dl> <h3>Derived from</h3> QWidget, Ui_MicroPythonWidget <h3>Class Attributes</h3> <table> <tr><td>DeviceBoardRole</td></tr> <tr><td>DeviceInterfaceTypeRole</td></tr> <tr><td>DevicePidRole</td></tr> <tr><td>DevicePortRole</td></tr> <tr><td>DeviceSerNoRole</td></tr> <tr><td>DeviceTypeRole</td></tr> <tr><td>DeviceVidRole</td></tr> <tr><td>DeviceWebreplUrlRole</td></tr> <tr><td>ManualMarker</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#MicroPythonWidget.__init__">MicroPythonWidget</a></td> <td>Constructor</td> </tr> <tr> <td><a href="#MicroPythonWidget.__aboutToShowSuperMenu">__aboutToShowSuperMenu</a></td> <td>Private slot to populate the Super Menu before showing it.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__addUnknownDevices">__addUnknownDevices</a></td> <td>Private method to add devices to the list of manually added boards.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__compileEditor2Mpy">__compileEditor2Mpy</a></td> <td>Private slot to cross compile the current editor to a .mpy file.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__compileFile2Mpy">__compileFile2Mpy</a></td> <td>Private slot to cross compile a Python file (*.py) to a .mpy file.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__configure">__configure</a></td> <td>Private slot to open the MicroPython configuration page.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__configureWebreplUrls">__configureWebreplUrls</a></td> <td>Private slot to configure the list of selectable WebREPL URLs.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__connectToDevice">__connectToDevice</a></td> <td>Private method to connect to the selected device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__convertToUF2">__convertToUF2</a></td> <td>Private slot to convert a non-UF2 MicroPython firmware file to UF2.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__crossCompile">__crossCompile</a></td> <td>Private method to cross compile a Python file to a .mpy file.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__disconnectFromDevice">__disconnectFromDevice</a></td> <td>Private method to disconnect from the device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__downloadFirmware">__downloadFirmware</a></td> <td>Private slot to open the firmware download page.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__downloadFromUrl">__downloadFromUrl</a></td> <td>Private method to open a web browser for the given URL.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__flashUF2">__flashUF2</a></td> <td>Private slot to flash MicroPython/CircuitPython to a device support the UF2 bootloader.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__getDeviceTime">__getDeviceTime</a></td> <td>Private method to get a string containing the date and time of the connected device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__handlePreferencesChanged">__handlePreferencesChanged</a></td> <td>Private slot to handle a change in preferences.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__installPackage">__installPackage</a></td> <td>Private slot to install packages using the given method.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__manageIgnored">__manageIgnored</a></td> <td>Private slot to manage the list of ignored serial devices.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__manageUnknownDevices">__manageUnknownDevices</a></td> <td>Private slot to manage manually added boards (i.e.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__mpyCrossAvailable">__mpyCrossAvailable</a></td> <td>Private method to check the availability of mpy-cross.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__populateDeviceTypeComboBox">__populateDeviceTypeComboBox</a></td> <td>Private method to populate the device type selector.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__quit">__quit</a></td> <td>Private slot to quit the main (MicroPython) window.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__setConnected">__setConnected</a></td> <td>Private method to set the connection status LED.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__showBoardInformation">__showBoardInformation</a></td> <td>Private slot to show all available information about a board.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__showBuiltinModules">__showBuiltinModules</a></td> <td>Private slot to show a list of builtin modules.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__showDeviceTime">__showDeviceTime</a></td> <td>Private slot to show the date and time of the connected device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__showDeviceVersion">__showDeviceVersion</a></td> <td>Private slot to show some version info about MicroPython of the device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__showDocumentation">__showDocumentation</a></td> <td>Private slot to open the documentation URL for the selected device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__showImplementation">__showImplementation</a></td> <td>Private slot to show some implementation related information.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__showLocalAndDeviceTime">__showLocalAndDeviceTime</a></td> <td>Private slot to show the local and device time side-by-side.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__showLocalTime">__showLocalTime</a></td> <td>Private slot to show the local date and time.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__showNoDeviceMessage">__showNoDeviceMessage</a></td> <td>Private method to show a message dialog indicating a missing device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__shutdown">__shutdown</a></td> <td>Private method to perform some shutdown actions.</td> </tr> <tr> <td><a href="#MicroPythonWidget.__synchronizeTime">__synchronizeTime</a></td> <td>Private slot to set the time of the connected device to the local computer's time.</td> </tr> <tr> <td><a href="#MicroPythonWidget.deviceInterface">deviceInterface</a></td> <td>Public method to get a reference to the device interface object.</td> </tr> <tr> <td><a href="#MicroPythonWidget.deviceSupportsLocalFileAccess">deviceSupportsLocalFileAccess</a></td> <td>Public method to indicate that the device access the device file system via a local directory.</td> </tr> <tr> <td><a href="#MicroPythonWidget.getCurrentPort">getCurrentPort</a></td> <td>Public method to determine the port path of the selected device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.getDevice">getDevice</a></td> <td>Public method to get a reference to the current device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.getDeviceWorkspace">getDeviceWorkspace</a></td> <td>Public method to get the workspace directory of the device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.getFileManager">getFileManager</a></td> <td>Public method to get a reference to the file manager interface.</td> </tr> <tr> <td><a href="#MicroPythonWidget.handleDataFlood">handleDataFlood</a></td> <td>Public slot handling a data flood from the device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.insertData">insertData</a></td> <td>Public method to insert some data as if it was sent directly from the device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.isConnected">isConnected</a></td> <td>Public method to get the MicroPython device connection state.</td> </tr> <tr> <td><a href="#MicroPythonWidget.isLinkConnected">isLinkConnected</a></td> <td>Public method to get the link connection state.</td> </tr> <tr> <td><a href="#MicroPythonWidget.isMicrobit">isMicrobit</a></td> <td>Public method to check, if the connected/selected device is a BBC micro:bit or Calliope mini.</td> </tr> <tr> <td><a href="#MicroPythonWidget.on_chartButton_clicked">on_chartButton_clicked</a></td> <td>Private slot to open a chart view to plot data received from the connected device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.on_connectButton_clicked">on_connectButton_clicked</a></td> <td>Private slot to connect to the selected device or disconnect from the currently connected device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.on_deviceTypeComboBox_activated">on_deviceTypeComboBox_activated</a></td> <td>Private slot handling the selection of a device type.</td> </tr> <tr> <td><a href="#MicroPythonWidget.on_filesButton_clicked">on_filesButton_clicked</a></td> <td>Private slot to open a file manager window to the connected device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.on_replButton_clicked">on_replButton_clicked</a></td> <td>Private slot to connect to enable or disable the REPL widget.</td> </tr> <tr> <td><a href="#MicroPythonWidget.on_runButton_clicked">on_runButton_clicked</a></td> <td>Private slot to execute the script of the active editor on the selected device.</td> </tr> <tr> <td><a href="#MicroPythonWidget.setActionButtons">setActionButtons</a></td> <td>Public method to set the enabled state of the various action buttons.</td> </tr> <tr> <td><a href="#MicroPythonWidget.showError">showError</a></td> <td>Public method to show some error message.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="MicroPythonWidget.__init__" ID="MicroPythonWidget.__init__"></a> <h4>MicroPythonWidget (Constructor)</h4> <b>MicroPythonWidget</b>(<i>parent=None, forMPyWindow=False</i>) <p> Constructor </p> <dl> <dt><i>parent</i> (QWidget (optional))</dt> <dd> reference to the parent widget (defaults to None) </dd> <dt><i>forMPyWindow</i> (bool (optional))</dt> <dd> flag indicating the MicroPythonWindow variant (defaults to False) </dd> </dl> <a NAME="MicroPythonWidget.__aboutToShowSuperMenu" ID="MicroPythonWidget.__aboutToShowSuperMenu"></a> <h4>MicroPythonWidget.__aboutToShowSuperMenu</h4> <b>__aboutToShowSuperMenu</b>(<i></i>) <p> Private slot to populate the Super Menu before showing it. </p> <a NAME="MicroPythonWidget.__addUnknownDevices" ID="MicroPythonWidget.__addUnknownDevices"></a> <h4>MicroPythonWidget.__addUnknownDevices</h4> <b>__addUnknownDevices</b>(<i>devices</i>) <p> Private method to add devices to the list of manually added boards. </p> <dl> <dt><i>devices</i> (list of tuple of (int, int, str))</dt> <dd> list of not ignored but unknown devices </dd> </dl> <a NAME="MicroPythonWidget.__compileEditor2Mpy" ID="MicroPythonWidget.__compileEditor2Mpy"></a> <h4>MicroPythonWidget.__compileEditor2Mpy</h4> <b>__compileEditor2Mpy</b>(<i></i>) <p> Private slot to cross compile the current editor to a .mpy file. </p> <a NAME="MicroPythonWidget.__compileFile2Mpy" ID="MicroPythonWidget.__compileFile2Mpy"></a> <h4>MicroPythonWidget.__compileFile2Mpy</h4> <b>__compileFile2Mpy</b>(<i></i>) <p> Private slot to cross compile a Python file (*.py) to a .mpy file. </p> <a NAME="MicroPythonWidget.__configure" ID="MicroPythonWidget.__configure"></a> <h4>MicroPythonWidget.__configure</h4> <b>__configure</b>(<i></i>) <p> Private slot to open the MicroPython configuration page. </p> <a NAME="MicroPythonWidget.__configureWebreplUrls" ID="MicroPythonWidget.__configureWebreplUrls"></a> <h4>MicroPythonWidget.__configureWebreplUrls</h4> <b>__configureWebreplUrls</b>(<i></i>) <p> Private slot to configure the list of selectable WebREPL URLs. </p> <a NAME="MicroPythonWidget.__connectToDevice" ID="MicroPythonWidget.__connectToDevice"></a> <h4>MicroPythonWidget.__connectToDevice</h4> <b>__connectToDevice</b>(<i>withAutostart=False</i>) <p> Private method to connect to the selected device. </p> <dl> <dt><i>withAutostart</i> (bool)</dt> <dd> flag indicating to start the repl and file manager automatically </dd> </dl> <dl> <dt>Raises <b>ValueError</b>:</dt> <dd> raised to indicate an unsupported interface type </dd> </dl> <a NAME="MicroPythonWidget.__convertToUF2" ID="MicroPythonWidget.__convertToUF2"></a> <h4>MicroPythonWidget.__convertToUF2</h4> <b>__convertToUF2</b>(<i></i>) <p> Private slot to convert a non-UF2 MicroPython firmware file to UF2. </p> <a NAME="MicroPythonWidget.__crossCompile" ID="MicroPythonWidget.__crossCompile"></a> <h4>MicroPythonWidget.__crossCompile</h4> <b>__crossCompile</b>(<i>pythonFile="", title=""</i>) <p> Private method to cross compile a Python file to a .mpy file. </p> <dl> <dt><i>pythonFile</i> (str)</dt> <dd> name of the Python file to be compiled </dd> <dt><i>title</i> (str)</dt> <dd> title for the various dialogs </dd> </dl> <a NAME="MicroPythonWidget.__disconnectFromDevice" ID="MicroPythonWidget.__disconnectFromDevice"></a> <h4>MicroPythonWidget.__disconnectFromDevice</h4> <b>__disconnectFromDevice</b>(<i></i>) <p> Private method to disconnect from the device. </p> <a NAME="MicroPythonWidget.__downloadFirmware" ID="MicroPythonWidget.__downloadFirmware"></a> <h4>MicroPythonWidget.__downloadFirmware</h4> <b>__downloadFirmware</b>(<i></i>) <p> Private slot to open the firmware download page. </p> <a NAME="MicroPythonWidget.__downloadFromUrl" ID="MicroPythonWidget.__downloadFromUrl"></a> <h4>MicroPythonWidget.__downloadFromUrl</h4> <b>__downloadFromUrl</b>(<i>url</i>) <p> Private method to open a web browser for the given URL. </p> <dl> <dt><i>url</i> (str)</dt> <dd> URL to be opened </dd> </dl> <a NAME="MicroPythonWidget.__flashUF2" ID="MicroPythonWidget.__flashUF2"></a> <h4>MicroPythonWidget.__flashUF2</h4> <b>__flashUF2</b>(<i></i>) <p> Private slot to flash MicroPython/CircuitPython to a device support the UF2 bootloader. </p> <a NAME="MicroPythonWidget.__getDeviceTime" ID="MicroPythonWidget.__getDeviceTime"></a> <h4>MicroPythonWidget.__getDeviceTime</h4> <b>__getDeviceTime</b>(<i></i>) <p> Private method to get a string containing the date and time of the connected device. </p> <dl> <dt>Return:</dt> <dd> date and time of the connected device </dd> </dl> <dl> <dt>Return Type:</dt> <dd> str </dd> </dl> <a NAME="MicroPythonWidget.__handlePreferencesChanged" ID="MicroPythonWidget.__handlePreferencesChanged"></a> <h4>MicroPythonWidget.__handlePreferencesChanged</h4> <b>__handlePreferencesChanged</b>(<i></i>) <p> Private slot to handle a change in preferences. </p> <a NAME="MicroPythonWidget.__installPackage" ID="MicroPythonWidget.__installPackage"></a> <h4>MicroPythonWidget.__installPackage</h4> <b>__installPackage</b>(<i>method</i>) <p> Private slot to install packages using the given method. </p> <dl> <dt><i>method</i> (str)</dt> <dd> package management method to be used (one of 'upip' or 'mip') </dd> </dl> <dl> <dt>Raises <b>ValueError</b>:</dt> <dd> raised to indicate an unsupported package management method </dd> </dl> <a NAME="MicroPythonWidget.__manageIgnored" ID="MicroPythonWidget.__manageIgnored"></a> <h4>MicroPythonWidget.__manageIgnored</h4> <b>__manageIgnored</b>(<i></i>) <p> Private slot to manage the list of ignored serial devices. </p> <a NAME="MicroPythonWidget.__manageUnknownDevices" ID="MicroPythonWidget.__manageUnknownDevices"></a> <h4>MicroPythonWidget.__manageUnknownDevices</h4> <b>__manageUnknownDevices</b>(<i></i>) <p> Private slot to manage manually added boards (i.e. those not in the list of supported boards). </p> <a NAME="MicroPythonWidget.__mpyCrossAvailable" ID="MicroPythonWidget.__mpyCrossAvailable"></a> <h4>MicroPythonWidget.__mpyCrossAvailable</h4> <b>__mpyCrossAvailable</b>(<i></i>) <p> Private method to check the availability of mpy-cross. </p> <dl> <dt>Return:</dt> <dd> flag indicating the availability of mpy-cross </dd> </dl> <dl> <dt>Return Type:</dt> <dd> bool </dd> </dl> <a NAME="MicroPythonWidget.__populateDeviceTypeComboBox" ID="MicroPythonWidget.__populateDeviceTypeComboBox"></a> <h4>MicroPythonWidget.__populateDeviceTypeComboBox</h4> <b>__populateDeviceTypeComboBox</b>(<i></i>) <p> Private method to populate the device type selector. </p> <a NAME="MicroPythonWidget.__quit" ID="MicroPythonWidget.__quit"></a> <h4>MicroPythonWidget.__quit</h4> <b>__quit</b>(<i></i>) <p> Private slot to quit the main (MicroPython) window. </p> <a NAME="MicroPythonWidget.__setConnected" ID="MicroPythonWidget.__setConnected"></a> <h4>MicroPythonWidget.__setConnected</h4> <b>__setConnected</b>(<i>connected</i>) <p> Private method to set the connection status LED. </p> <dl> <dt><i>connected</i> (bool)</dt> <dd> connection state </dd> </dl> <a NAME="MicroPythonWidget.__showBoardInformation" ID="MicroPythonWidget.__showBoardInformation"></a> <h4>MicroPythonWidget.__showBoardInformation</h4> <b>__showBoardInformation</b>(<i></i>) <p> Private slot to show all available information about a board. </p> <a NAME="MicroPythonWidget.__showBuiltinModules" ID="MicroPythonWidget.__showBuiltinModules"></a> <h4>MicroPythonWidget.__showBuiltinModules</h4> <b>__showBuiltinModules</b>(<i></i>) <p> Private slot to show a list of builtin modules. </p> <a NAME="MicroPythonWidget.__showDeviceTime" ID="MicroPythonWidget.__showDeviceTime"></a> <h4>MicroPythonWidget.__showDeviceTime</h4> <b>__showDeviceTime</b>(<i></i>) <p> Private slot to show the date and time of the connected device. </p> <a NAME="MicroPythonWidget.__showDeviceVersion" ID="MicroPythonWidget.__showDeviceVersion"></a> <h4>MicroPythonWidget.__showDeviceVersion</h4> <b>__showDeviceVersion</b>(<i></i>) <p> Private slot to show some version info about MicroPython of the device. </p> <a NAME="MicroPythonWidget.__showDocumentation" ID="MicroPythonWidget.__showDocumentation"></a> <h4>MicroPythonWidget.__showDocumentation</h4> <b>__showDocumentation</b>(<i></i>) <p> Private slot to open the documentation URL for the selected device. </p> <a NAME="MicroPythonWidget.__showImplementation" ID="MicroPythonWidget.__showImplementation"></a> <h4>MicroPythonWidget.__showImplementation</h4> <b>__showImplementation</b>(<i></i>) <p> Private slot to show some implementation related information. </p> <a NAME="MicroPythonWidget.__showLocalAndDeviceTime" ID="MicroPythonWidget.__showLocalAndDeviceTime"></a> <h4>MicroPythonWidget.__showLocalAndDeviceTime</h4> <b>__showLocalAndDeviceTime</b>(<i></i>) <p> Private slot to show the local and device time side-by-side. </p> <a NAME="MicroPythonWidget.__showLocalTime" ID="MicroPythonWidget.__showLocalTime"></a> <h4>MicroPythonWidget.__showLocalTime</h4> <b>__showLocalTime</b>(<i></i>) <p> Private slot to show the local date and time. </p> <a NAME="MicroPythonWidget.__showNoDeviceMessage" ID="MicroPythonWidget.__showNoDeviceMessage"></a> <h4>MicroPythonWidget.__showNoDeviceMessage</h4> <b>__showNoDeviceMessage</b>(<i></i>) <p> Private method to show a message dialog indicating a missing device. </p> <a NAME="MicroPythonWidget.__shutdown" ID="MicroPythonWidget.__shutdown"></a> <h4>MicroPythonWidget.__shutdown</h4> <b>__shutdown</b>(<i></i>) <p> Private method to perform some shutdown actions. </p> <a NAME="MicroPythonWidget.__synchronizeTime" ID="MicroPythonWidget.__synchronizeTime"></a> <h4>MicroPythonWidget.__synchronizeTime</h4> <b>__synchronizeTime</b>(<i>quiet=False</i>) <p> Private slot to set the time of the connected device to the local computer's time. </p> <dl> <dt><i>quiet</i> (bool)</dt> <dd> flag indicating to not show a message </dd> </dl> <a NAME="MicroPythonWidget.deviceInterface" ID="MicroPythonWidget.deviceInterface"></a> <h4>MicroPythonWidget.deviceInterface</h4> <b>deviceInterface</b>(<i></i>) <p> Public method to get a reference to the device interface object. </p> <dl> <dt>Return:</dt> <dd> reference to the commands interface object </dd> </dl> <dl> <dt>Return Type:</dt> <dd> MicroPythonDeviceInterface </dd> </dl> <a NAME="MicroPythonWidget.deviceSupportsLocalFileAccess" ID="MicroPythonWidget.deviceSupportsLocalFileAccess"></a> <h4>MicroPythonWidget.deviceSupportsLocalFileAccess</h4> <b>deviceSupportsLocalFileAccess</b>(<i></i>) <p> Public method to indicate that the device access the device file system via a local directory. </p> <dl> <dt>Return:</dt> <dd> flag indicating file access via local directory </dd> </dl> <dl> <dt>Return Type:</dt> <dd> bool </dd> </dl> <a NAME="MicroPythonWidget.getCurrentPort" ID="MicroPythonWidget.getCurrentPort"></a> <h4>MicroPythonWidget.getCurrentPort</h4> <b>getCurrentPort</b>(<i></i>) <p> Public method to determine the port path of the selected device. </p> <dl> <dt>Return:</dt> <dd> path of the port of the selected device </dd> </dl> <dl> <dt>Return Type:</dt> <dd> str </dd> </dl> <a NAME="MicroPythonWidget.getDevice" ID="MicroPythonWidget.getDevice"></a> <h4>MicroPythonWidget.getDevice</h4> <b>getDevice</b>(<i></i>) <p> Public method to get a reference to the current device. </p> <dl> <dt>Return:</dt> <dd> reference to the current device </dd> </dl> <dl> <dt>Return Type:</dt> <dd> BaseDevice </dd> </dl> <a NAME="MicroPythonWidget.getDeviceWorkspace" ID="MicroPythonWidget.getDeviceWorkspace"></a> <h4>MicroPythonWidget.getDeviceWorkspace</h4> <b>getDeviceWorkspace</b>(<i></i>) <p> Public method to get the workspace directory of the device. </p> <dl> <dt>Return:</dt> <dd> workspace directory of the device </dd> </dl> <dl> <dt>Return Type:</dt> <dd> str </dd> </dl> <a NAME="MicroPythonWidget.getFileManager" ID="MicroPythonWidget.getFileManager"></a> <h4>MicroPythonWidget.getFileManager</h4> <b>getFileManager</b>(<i></i>) <p> Public method to get a reference to the file manager interface. </p> <dl> <dt>Return:</dt> <dd> reference to the file manager interface </dd> </dl> <dl> <dt>Return Type:</dt> <dd> MicroPythonFileManager </dd> </dl> <a NAME="MicroPythonWidget.handleDataFlood" ID="MicroPythonWidget.handleDataFlood"></a> <h4>MicroPythonWidget.handleDataFlood</h4> <b>handleDataFlood</b>(<i></i>) <p> Public slot handling a data flood from the device. </p> <a NAME="MicroPythonWidget.insertData" ID="MicroPythonWidget.insertData"></a> <h4>MicroPythonWidget.insertData</h4> <b>insertData</b>(<i>data</i>) <p> Public method to insert some data as if it was sent directly from the device. </p> <dl> <dt><i>data</i> (str or bytes)</dt> <dd> data to be inserted into the REPL pane </dd> </dl> <a NAME="MicroPythonWidget.isConnected" ID="MicroPythonWidget.isConnected"></a> <h4>MicroPythonWidget.isConnected</h4> <b>isConnected</b>(<i></i>) <p> Public method to get the MicroPython device connection state. </p> <dl> <dt>Return:</dt> <dd> connection state </dd> </dl> <dl> <dt>Return Type:</dt> <dd> bool </dd> </dl> <a NAME="MicroPythonWidget.isLinkConnected" ID="MicroPythonWidget.isLinkConnected"></a> <h4>MicroPythonWidget.isLinkConnected</h4> <b>isLinkConnected</b>(<i></i>) <p> Public method to get the link connection state. </p> <dl> <dt>Return:</dt> <dd> connection state </dd> </dl> <dl> <dt>Return Type:</dt> <dd> bool </dd> </dl> <a NAME="MicroPythonWidget.isMicrobit" ID="MicroPythonWidget.isMicrobit"></a> <h4>MicroPythonWidget.isMicrobit</h4> <b>isMicrobit</b>(<i></i>) <p> Public method to check, if the connected/selected device is a BBC micro:bit or Calliope mini. </p> <dl> <dt>Return:</dt> <dd> flag indicating a micro:bit device </dd> </dl> <dl> <dt>Return Type:</dt> <dd> bool </dd> </dl> <a NAME="MicroPythonWidget.on_chartButton_clicked" ID="MicroPythonWidget.on_chartButton_clicked"></a> <h4>MicroPythonWidget.on_chartButton_clicked</h4> <b>on_chartButton_clicked</b>(<i>checked</i>) <p> Private slot to open a chart view to plot data received from the connected device. </p> <p> If the selected device is not connected yet, this will be done now. </p> <dl> <dt><i>checked</i> (bool)</dt> <dd> state of the button </dd> </dl> <a NAME="MicroPythonWidget.on_connectButton_clicked" ID="MicroPythonWidget.on_connectButton_clicked"></a> <h4>MicroPythonWidget.on_connectButton_clicked</h4> <b>on_connectButton_clicked</b>(<i></i>) <p> Private slot to connect to the selected device or disconnect from the currently connected device. </p> <a NAME="MicroPythonWidget.on_deviceTypeComboBox_activated" ID="MicroPythonWidget.on_deviceTypeComboBox_activated"></a> <h4>MicroPythonWidget.on_deviceTypeComboBox_activated</h4> <b>on_deviceTypeComboBox_activated</b>(<i>index</i>) <p> Private slot handling the selection of a device type. </p> <dl> <dt><i>index</i> (int)</dt> <dd> index of the selected device </dd> </dl> <a NAME="MicroPythonWidget.on_filesButton_clicked" ID="MicroPythonWidget.on_filesButton_clicked"></a> <h4>MicroPythonWidget.on_filesButton_clicked</h4> <b>on_filesButton_clicked</b>(<i>checked</i>) <p> Private slot to open a file manager window to the connected device. </p> <p> If the selected device is not connected yet, this will be done now. </p> <dl> <dt><i>checked</i> (bool)</dt> <dd> state of the button </dd> </dl> <a NAME="MicroPythonWidget.on_replButton_clicked" ID="MicroPythonWidget.on_replButton_clicked"></a> <h4>MicroPythonWidget.on_replButton_clicked</h4> <b>on_replButton_clicked</b>(<i>checked</i>) <p> Private slot to connect to enable or disable the REPL widget. </p> <p> If the selected device is not connected yet, this will be done now. </p> <dl> <dt><i>checked</i> (bool)</dt> <dd> state of the button </dd> </dl> <a NAME="MicroPythonWidget.on_runButton_clicked" ID="MicroPythonWidget.on_runButton_clicked"></a> <h4>MicroPythonWidget.on_runButton_clicked</h4> <b>on_runButton_clicked</b>(<i></i>) <p> Private slot to execute the script of the active editor on the selected device. </p> <p> If the REPL is not active yet, it will be activated, which might cause an unconnected device to be connected. </p> <a NAME="MicroPythonWidget.setActionButtons" ID="MicroPythonWidget.setActionButtons"></a> <h4>MicroPythonWidget.setActionButtons</h4> <b>setActionButtons</b>(<i>**kwargs</i>) <p> Public method to set the enabled state of the various action buttons. </p> <dl> <dt><i>kwargs=</i> (dict)</dt> <dd> keyword arguments containg the enabled states (keys are 'run', 'repl', 'files', 'chart', 'open', 'save' </dd> </dl> <a NAME="MicroPythonWidget.showError" ID="MicroPythonWidget.showError"></a> <h4>MicroPythonWidget.showError</h4> <b>showError</b>(<i>method, error</i>) <p> Public method to show some error message. </p> <dl> <dt><i>method</i> (str)</dt> <dd> name of the method the error occured in </dd> <dt><i>error</i> (str)</dt> <dd> error message </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>