13 |
13 |
14 from PyQt6.QtCore import QCoreApplication, QEventLoop, Qt, QThread, pyqtSlot |
14 from PyQt6.QtCore import QCoreApplication, QEventLoop, Qt, QThread, pyqtSlot |
15 from PyQt6.QtSerialPort import QSerialPortInfo |
15 from PyQt6.QtSerialPort import QSerialPortInfo |
16 from PyQt6.QtWidgets import QDialog |
16 from PyQt6.QtWidgets import QDialog |
17 |
17 |
18 from eric7 import Utilities |
|
19 from eric7.EricGui import EricPixmapCache |
18 from eric7.EricGui import EricPixmapCache |
20 from eric7.EricWidgets.EricApplication import ericApp |
19 from eric7.EricWidgets.EricApplication import ericApp |
21 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
20 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
|
21 from eric7.SystemUtilities import FileSystemUtilities |
22 |
22 |
23 from . import MicroPythonDevices |
23 from . import MicroPythonDevices |
24 from .Ui_UF2FlashDialog import Ui_UF2FlashDialog |
24 from .Ui_UF2FlashDialog import Ui_UF2FlashDialog |
25 |
25 |
26 SupportedUF2Boards = { |
26 SupportedUF2Boards = { |
673 with contextlib.suppress(KeyError): |
673 with contextlib.suppress(KeyError): |
674 # find mounted volume |
674 # find mounted volume |
675 volumes = SupportedUF2Boards[board]["volumes"][(0, 0)] |
675 volumes = SupportedUF2Boards[board]["volumes"][(0, 0)] |
676 foundVolumes = [] |
676 foundVolumes = [] |
677 for volume in volumes: |
677 for volume in volumes: |
678 foundVolumes += Utilities.findVolume(volume, findAll=True) |
678 foundVolumes += FileSystemUtilities.findVolume(volume, findAll=True) |
679 if foundVolumes: |
679 if foundVolumes: |
680 foundDevices.append( |
680 foundDevices.append( |
681 ( |
681 ( |
682 board, |
682 board, |
683 QCoreApplication.translate( |
683 QCoreApplication.translate( |
1037 self.bootPicker.clear() |
1037 self.bootPicker.clear() |
1038 else: |
1038 else: |
1039 volumes = SupportedUF2Boards[boardType]["volumes"][vidpid] |
1039 volumes = SupportedUF2Boards[boardType]["volumes"][vidpid] |
1040 foundVolumes = [] |
1040 foundVolumes = [] |
1041 for volume in volumes: |
1041 for volume in volumes: |
1042 foundVolumes += Utilities.findVolume(volume, findAll=True) |
1042 foundVolumes += FileSystemUtilities.findVolume(volume, findAll=True) |
1043 |
1043 |
1044 if len(foundVolumes) == 0: |
1044 if len(foundVolumes) == 0: |
1045 self.__showNoVolumeInformation(volumes, boardType) |
1045 self.__showNoVolumeInformation(volumes, boardType) |
1046 self.bootPicker.clear() |
1046 self.bootPicker.clear() |
1047 elif len(foundVolumes) == 1: |
1047 elif len(foundVolumes) == 1: |