15 |
15 |
16 from PyQt6.QtCore import QStandardPaths, QUrl, pyqtSlot |
16 from PyQt6.QtCore import QStandardPaths, QUrl, pyqtSlot |
17 from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest |
17 from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest |
18 from PyQt6.QtWidgets import QMenu |
18 from PyQt6.QtWidgets import QMenu |
19 |
19 |
20 from eric7 import Globals, Preferences |
20 from eric7 import EricUtilities, Preferences |
21 from eric7.EricWidgets import EricFileDialog, EricMessageBox |
21 from eric7.EricWidgets import EricFileDialog, EricMessageBox |
22 from eric7.EricWidgets.EricApplication import ericApp |
22 from eric7.EricWidgets.EricApplication import ericApp |
23 from eric7.SystemUtilities import FileSystemUtilities |
23 from eric7.SystemUtilities import FileSystemUtilities |
24 |
24 |
25 from ..MicroPythonWidget import HAS_QTCHART |
25 from ..MicroPythonWidget import HAS_QTCHART |
444 latestUrl = reply.url().toString() |
444 latestUrl = reply.url().toString() |
445 tag = latestUrl.rsplit("/", 1)[-1] |
445 tag = latestUrl.rsplit("/", 1)[-1] |
446 while tag and not tag[0].isdecimal(): |
446 while tag and not tag[0].isdecimal(): |
447 # get rid of leading non-decimal characters |
447 # get rid of leading non-decimal characters |
448 tag = tag[1:] |
448 tag = tag[1:] |
449 latestVersion = Globals.versionToTuple(tag) |
449 latestVersion = EricUtilities.versionToTuple(tag) |
450 |
450 |
451 if self._deviceData["release"] == "unknown": |
451 if self._deviceData["release"] == "unknown": |
452 currentVersionStr = self.tr("unknown") |
452 currentVersionStr = self.tr("unknown") |
453 currentVersion = (0, 0, 0) |
453 currentVersion = (0, 0, 0) |
454 else: |
454 else: |
455 currentVersionStr = self._deviceData["release"] |
455 currentVersionStr = self._deviceData["release"] |
456 currentVersion = Globals.versionToTuple(currentVersionStr) |
456 currentVersion = EricUtilities.versionToTuple(currentVersionStr) |
457 |
457 |
458 if self._deviceData["mpy_name"] == "circuitpython": |
458 if self._deviceData["mpy_name"] == "circuitpython": |
459 kind = "CircuitPython" |
459 kind = "CircuitPython" |
460 microbitVersion = "2" # only v2 device can run CircuitPython |
460 microbitVersion = "2" # only v2 device can run CircuitPython |
461 elif self._deviceData["mpy_name"] == "micropython": |
461 elif self._deviceData["mpy_name"] == "micropython": |