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

Function updateSoftwareVersion

src/astroprint/api/settings.py:602–620  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

600@api.route("/settings/software/update", methods=['POST', 'DELETE'])
601@restricted_access
602def updateSoftwareVersion():
603 if request.method == 'DELETE':
604 softwareManager.resetUpdate()
605 return jsonify()
606
607 else:
608 data = request.get_json()
609 total, used, free = platformManager().driveStats()
610
611 if free > 1073741824: # 1 GB
612 if 'release_ids' in data:
613 if softwareManager.updateSoftware(data['release_ids']):
614 return jsonify()
615 else:
616 return ("Unable to update", 500)
617 else:
618 return ("Invalid data", 400)
619 else:
620 return ("Not enough space", 507)
621
622@api.route("/settings/software/restart", methods=['POST'])
623@restricted_access

Callers

nothing calls this directly

Calls 4

platformManagerFunction · 0.90
resetUpdateMethod · 0.80
driveStatsMethod · 0.80
updateSoftwareMethod · 0.80

Tested by

no test coverage detected