--- a/eric6/MicroPython/MicrobitDevices.py Fri Feb 19 17:34:33 2021 +0100 +++ b/eric6/MicroPython/MicrobitDevices.py Sat Feb 20 11:52:49 2021 +0100 @@ -39,9 +39,8 @@ @param parent reference to the parent object @type QObject """ - super(MicrobitDevice, self).__init__(microPythonWidget, parent) - - self.__deviceType = deviceType + super(MicrobitDevice, self).__init__( + microPythonWidget, deviceType, parent) def setButtons(self): """ @@ -68,7 +67,7 @@ @return name of the device @rtype str """ - if self.__deviceType == "bbc_microbit": + if self.getDeviceType() == "bbc_microbit": # BBC micro:bit return self.tr("BBC micro:bit") else: @@ -187,7 +186,7 @@ # Attempts to find the path on the file system that represents the # plugged in micro:bit board. To flash the DAPLink firmware, it must be # in maintenance mode, for MicroPython in standard mode. - if self.__deviceType == "bbc_microbit": + if self.getDeviceType() == "bbc_microbit": # BBC micro:bit if firmware: deviceDirectories = Utilities.findVolume("MAINTENANCE", @@ -204,7 +203,7 @@ deviceDirectories = Utilities.findVolume("MINI", findAll=True) if len(deviceDirectories) == 0: - if self.__deviceType == "bbc_microbit": + if self.getDeviceType() == "bbc_microbit": # BBC micro:bit is not ready or not mounted if firmware: E5MessageBox.critical( @@ -366,7 +365,7 @@ """ Private slot to reset the connected device. """ - if self.__deviceType == "bbc_microbit": + if self.getDeviceType() == "bbc_microbit": # BBC micro:bit self.microPython.commandsInterface().execute([ "import microbit", @@ -386,7 +385,7 @@ @return documentation URL of the device @rtype str """ - if self.__deviceType == "bbc_microbit": + if self.getDeviceType() == "bbc_microbit": # BBC micro:bit return Preferences.getMicroPython("MicrobitDocuUrl") else: @@ -401,7 +400,7 @@ entry @rtype list of tuple of (str, str) """ - if self.__deviceType == "bbc_microbit": + if self.getDeviceType() == "bbc_microbit": return [ (self.tr("MicroPython Firmware for BBC micro:bit V1"), Preferences.getMicroPython("MicrobitMicroPythonUrl")),