371 ) |
371 ) |
372 if firmware and os.path.exists(firmware): |
372 if firmware and os.path.exists(firmware): |
373 shutil.copy2(firmware, deviceDirectories[0]) |
373 shutil.copy2(firmware, deviceDirectories[0]) |
374 else: |
374 else: |
375 EricMessageBox.warning( |
375 EricMessageBox.warning( |
376 self, |
376 self.microPython, |
377 self.tr("Flash MicroPython/Firmware"), |
377 self.tr("Flash MicroPython/Firmware"), |
378 self.tr( |
378 self.tr( |
379 "There are multiple devices ready for flashing." |
379 "There are multiple devices ready for flashing." |
380 " Please make sure, that only one device is prepared." |
380 " Please make sure, that only one device is prepared." |
381 ), |
381 ), |
388 available firmware version. |
388 available firmware version. |
389 """ |
389 """ |
390 if self.microPython.isConnected() and self.checkDeviceData(quiet=False): |
390 if self.microPython.isConnected() and self.checkDeviceData(quiet=False): |
391 if self._deviceData["mpy_name"] not in ("micropython", "circuitpython"): |
391 if self._deviceData["mpy_name"] not in ("micropython", "circuitpython"): |
392 EricMessageBox.critical( |
392 EricMessageBox.critical( |
393 None, |
393 self.microPython, |
394 self.tr("Show MicroPython Versions"), |
394 self.tr("Show MicroPython Versions"), |
395 self.tr( |
395 self.tr( |
396 """The firmware of the connected device cannot be""" |
396 """The firmware of the connected device cannot be""" |
397 """ determined or the board does not run MicroPython""" |
397 """ determined or the board does not run MicroPython""" |
398 """ or CircuitPython. Aborting...""" |
398 """ or CircuitPython. Aborting...""" |
417 return |
417 return |
418 elif self._deviceData["mpy_name"] == "circuitpython": |
418 elif self._deviceData["mpy_name"] == "circuitpython": |
419 url = QUrl(FirmwareGithubUrls["circuitpython"]) |
419 url = QUrl(FirmwareGithubUrls["circuitpython"]) |
420 else: |
420 else: |
421 EricMessageBox.critical( |
421 EricMessageBox.critical( |
422 None, |
422 self.microPython, |
423 self.tr("Show MicroPython Versions"), |
423 self.tr("Show MicroPython Versions"), |
424 self.tr( |
424 self.tr( |
425 """<p>The firmware URL for the device type <b>{0}</b>""" |
425 """<p>The firmware URL for the device type <b>{0}</b>""" |
426 """ is not known. Aborting...</p>""" |
426 """ is not known. Aborting...</p>""" |
427 ).format(self.getDeviceType()), |
427 ).format(self.getDeviceType()), |
478 ).format(kind, microbitVersion, currentVersionStr, tag) |
478 ).format(kind, microbitVersion, currentVersionStr, tag) |
479 if currentVersion < latestVersion: |
479 if currentVersion < latestVersion: |
480 msg += self.tr("<p><b>Update available!</b></p>") |
480 msg += self.tr("<p><b>Update available!</b></p>") |
481 |
481 |
482 EricMessageBox.information( |
482 EricMessageBox.information( |
483 None, |
483 self.microPython, |
484 self.tr("{0} Version").format(kind), |
484 self.tr("{0} Version").format(kind), |
485 msg, |
485 msg, |
486 ) |
486 ) |
487 |
487 |
488 @pyqtSlot() |
488 @pyqtSlot() |