src/eric7/MicroPython/Devices/MicrobitDevices.py

branch
mpy_network
changeset 9803
2ab3de60b51c
parent 9799
a79430a8811d
child 9820
67597e003373
equal deleted inserted replaced
9802:22aeee2bf35f 9803:2ab3de60b51c
51 if serialNumber: 51 if serialNumber:
52 with contextlib.suppress(ValueError): 52 with contextlib.suppress(ValueError):
53 self.__boardId = int(serialNumber[:4], 16) 53 self.__boardId = int(serialNumber[:4], 16)
54 54
55 self.__createMicrobitMenu() 55 self.__createMicrobitMenu()
56
57 def setConnected(self, connected):
58 """
59 Public method to set the connection state.
60
61 Note: This method can be overwritten to perform actions upon connect
62 or disconnect of the device.
63
64 @param connected connection state
65 @type bool
66 """
67 super().setConnected(connected)
68
69 if self.hasCircuitPython():
70 self.submitMode = "paste"
56 71
57 def setButtons(self): 72 def setButtons(self):
58 """ 73 """
59 Public method to enable the supported action buttons. 74 Public method to enable the supported action buttons.
60 """ 75 """
361 def __showFirmwareVersions(self): 376 def __showFirmwareVersions(self):
362 """ 377 """
363 Private slot to show the firmware version of the connected device and the 378 Private slot to show the firmware version of the connected device and the
364 available firmware version. 379 available firmware version.
365 """ 380 """
366 if self.microPython.isConnected() and self.checkDeviceData(): 381 if self.microPython.isConnected() and self.checkDeviceData(quiet=False):
367 if self._deviceData["mpy_name"] not in ("micropython", "circuitpython"): 382 if self._deviceData["mpy_name"] not in ("micropython", "circuitpython"):
368 EricMessageBox.critical( 383 EricMessageBox.critical(
369 None, 384 None,
370 self.tr("Show MicroPython Versions"), 385 self.tr("Show MicroPython Versions"),
371 self.tr( 386 self.tr(

eric ide

mercurial