MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / checkForcedUpdate

Method checkForcedUpdate

src/astroprint/software.py:441–455  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

439 return False
440
441 def checkForcedUpdate(self):
442 latestInfo = self.checkSoftwareVersion()
443
444 if latestInfo and latestInfo['update_available']:
445 for package in latestInfo['releases']:
446 if package['update_available'] and package['release']['forced'] and not package['is_current']:
447 self._logger.warn('New version %d.%d(%s) is forced and available for this box.' % (
448 package['release']['major'],
449 package['release']['minor'],
450 package['release']['build']
451 ))
452 if package['release']['date']:
453 package['release']['date'] = datetime.datetime.strptime(package['release']['date'], "%Y-%m-%d %H:%M:%S").date()
454 self.forceUpdateInfo = package['release']
455 return #When we find the first force that's enough
456
457 def checkSoftwareVersion(self):
458 apiHost = roConfig('cloud.apiHost')

Callers 1

runMethod · 0.80

Calls 1

checkSoftwareVersionMethod · 0.95

Tested by

no test coverage detected