src/eric7/MicroPython/Devices/RP2040Devices.py

branch
eric7
changeset 9772
06ef28082c4d
parent 9765
6378da868bb0
child 9775
c6806d24468b
child 9786
f94b530722af
equal deleted inserted replaced
9771:4d72243909ff 9772:06ef28082c4d
202 """ determined or the board does not run MicroPython.""" 202 """ determined or the board does not run MicroPython."""
203 """ Aborting...""" 203 """ Aborting..."""
204 ), 204 ),
205 ) 205 )
206 else: 206 else:
207 if self._deviceData["mpy_variant"] == "Pimoroni": 207 if self._deviceData["mpy_variant"] == "Pimoroni Pico":
208 # MicroPython with Pimoroni add-on libraries 208 # MicroPython with Pimoroni add-on libraries
209 url = QUrl(FirmwareGithubUrls["pimoroni_pico"]) 209 url = QUrl(FirmwareGithubUrls["pimoroni_pico"])
210 else: 210 else:
211 url = QUrl(FirmwareGithubUrls["micropython"]) 211 url = QUrl(FirmwareGithubUrls["micropython"])
212 ui = ericApp().getObject("UserInterface") 212 ui = ericApp().getObject("UserInterface")
230 230
231 if self._deviceData["mpy_version"] == "unknown": 231 if self._deviceData["mpy_version"] == "unknown":
232 currentVersionStr = self.tr("unknown") 232 currentVersionStr = self.tr("unknown")
233 currentVersion = (0, 0, 0) 233 currentVersion = (0, 0, 0)
234 else: 234 else:
235 currentVersionStr = self._deviceData["mpy_version"] 235 currentVersionStr = (
236 self._deviceData["mpy_variant_version"]
237 if bool(self._deviceData["mpy_variant_version"])
238 else self._deviceData["mpy_version"]
239 )
236 currentVersion = Globals.versionToTuple(currentVersionStr) 240 currentVersion = Globals.versionToTuple(currentVersionStr)
237 241
238 msg = self.tr( 242 msg = self.tr(
239 "<h4>MicroPython Version Information</h4>" 243 "<h4>MicroPython Version Information</h4>"
240 "<table>" 244 "<table>"
241 "<tr><td>Installed:</td><td>{0}</td><td></td></tr>" 245 "<tr><td>Installed:</td><td>{0}</td></tr>"
242 "<tr><td>Available:</td><td>{1}</td><td>{2}</td></tr>" 246 "<tr><td>Available:</td><td>{1}</td></tr>"
247 "{2}"
243 "</table>" 248 "</table>"
244 ).format( 249 ).format(
245 currentVersionStr, 250 currentVersionStr,
246 tag, 251 tag,
247 self.tr("({0})").format(self._deviceData["mpy_variant"]) 252 self.tr(
253 "<tr><td>Variant:</td><td>{0}</td></tr>"
254 ).format(self._deviceData["mpy_variant"])
248 if self._deviceData["mpy_variant"] 255 if self._deviceData["mpy_variant"]
249 else "", 256 else "",
250 ) 257 )
251 if ( 258 if (
252 self._deviceData["mpy_variant"] not in ["Pimoroni"] 259 self._deviceData["mpy_variant"] in ["Pimoroni Pico"]
253 and currentVersion < latestVersion 260 and not bool(self._deviceData["mpy_variant_version"])
254 ): 261 ):
255 # cannot derive that info for 'Pimoroni' variant 262 # cannot derive update info
263 msg += self.tr("<p>Update may be available.</p>")
264 elif currentVersion < latestVersion:
256 msg += self.tr("<p><b>Update available!</b></p>") 265 msg += self.tr("<p><b>Update available!</b></p>")
257 266
258 EricMessageBox.information( 267 EricMessageBox.information(
259 None, 268 None,
260 self.tr("MicroPython Version"), 269 self.tr("MicroPython Version"),

eric ide

mercurial