eric7.MicroPython.GenericMicroPythonDevices

Module implementing the device interface class for generic MicroPython devices (i.e. those devices not specifically supported yet).

Global Attributes

None

Classes

GenericMicroPythonDevice Class implementing the device interface for generic MicroPython boards.

Functions

createDevice Function to instantiate a MicroPython device object.


GenericMicroPythonDevice

Class implementing the device interface for generic MicroPython boards.

Derived from

MicroPythonDevice

Class Attributes

None

Class Methods

None

Methods

GenericMicroPythonDevice Constructor
__deviceVolumeMounted Private method to check, if the device volume is mounted.
__findWorkspace Private method to find the workspace directory.
canRunScript Public method to determine, if a script can be executed.
canStartFileManager Public method to determine, if a File Manager can be started.
canStartPlotter Public method to determine, if a Plotter can be started.
canStartRepl Public method to determine, if a REPL can be started.
deviceName Public method to get the name of the device.
getWorkspace Public method to get the workspace directory.
runScript Public method to run the given Python script.
setButtons Public method to enable the supported action buttons.
supportsLocalFileAccess Public method to indicate file access via a local directory.

Static Methods

None

GenericMicroPythonDevice (Constructor)

GenericMicroPythonDevice(microPythonWidget, deviceType, vid, pid, parent=None)

Constructor

microPythonWidget (MicroPythonWidget)
reference to the main MicroPython widget
deviceType (str)
device type assigned to this device interface
vid (int)
vendor ID
pid (int)
product ID
parent (QObject)
reference to the parent object

GenericMicroPythonDevice.__deviceVolumeMounted

__deviceVolumeMounted()

Private method to check, if the device volume is mounted.

Return:
flag indicated a mounted device
Return Type:
bool

GenericMicroPythonDevice.__findWorkspace

__findWorkspace(silent=False)

Private method to find the workspace directory.

silent (bool)
flag indicating silent operations
Return:
workspace directory used for saving files
Return Type:
str

GenericMicroPythonDevice.canRunScript

canRunScript()

Public method to determine, if a script can be executed.

Return:
tuple containing a flag indicating it is safe to start a Plotter and a reason why it cannot.
Return Type:
tuple of (bool, str)

GenericMicroPythonDevice.canStartFileManager

canStartFileManager()

Public method to determine, if a File Manager can be started.

Return:
tuple containing a flag indicating it is safe to start a File Manager and a reason why it cannot.
Return Type:
tuple of (bool, str)

GenericMicroPythonDevice.canStartPlotter

canStartPlotter()

Public method to determine, if a Plotter can be started.

Return:
tuple containing a flag indicating it is safe to start a Plotter and a reason why it cannot.
Return Type:
tuple of (bool, str)

GenericMicroPythonDevice.canStartRepl

canStartRepl()

Public method to determine, if a REPL can be started.

Return:
tuple containing a flag indicating it is safe to start a REPL and a reason why it cannot.
Return Type:
tuple of (bool, str)

GenericMicroPythonDevice.deviceName

deviceName()

Public method to get the name of the device.

Return:
name of the device
Return Type:
str

GenericMicroPythonDevice.getWorkspace

getWorkspace(silent=False)

Public method to get the workspace directory.

silent (bool)
flag indicating silent operations
Return:
workspace directory used for saving files
Return Type:
str

GenericMicroPythonDevice.runScript

runScript(script)

Public method to run the given Python script.

script (str)
script to be executed

GenericMicroPythonDevice.setButtons

setButtons()

Public method to enable the supported action buttons.

GenericMicroPythonDevice.supportsLocalFileAccess

supportsLocalFileAccess()

Public method to indicate file access via a local directory.

Return:
flag indicating file access via local directory
Return Type:
bool
Up


createDevice

createDevice(microPythonWidget, deviceType, vid, pid)

Function to instantiate a MicroPython device object.

microPythonWidget (MicroPythonWidget)
reference to the main MicroPython widget
deviceType (str)
device type assigned to this device interface
vid (int)
vendor ID
pid (int)
product ID
Return:
reference to the instantiated device object
Return Type:
GenericMicroPythonDevice
Up