def getLogSoftwareSettings(): s = settings() pm = platformManager() #Get files in the logs directory return jsonify(serialActivated=s.getBoolean(['serial', 'log']), files=pm.listLogs())
def updateSoftwareVersion(self, data, sendResponse): total, used, free = platformManager().driveStats() if free > 1073741824: # 1 GB if 'release_ids' in data: if softwareManager.updateSoftware(data['release_ids']): sendResponse({'success': 'no_error'}) return else: sendResponse("error_insufficient_storage", True) return sendResponse("error_init_update", True)
def getStorageSoftwareSettings(): pm = platformManager() driveTotal, driveUsed, driveFree = pm.driveStats() s = settings() clearFiles = s.getBoolean(['clearFiles']) return jsonify(sizeLogs=pm.logsSize(), sizeUploads=pm.uploadsSize(), driveTotal=driveTotal, driveUsed=driveUsed, driveFree=driveFree, clearFiles=clearFiles)
def deviceStorage(self, data, sendResponse): pm = platformManager() driveTotal, driveUsed, driveFree = pm.driveStats() s = settings() clearFiles = s.getBoolean(['clearFiles']) sendResponse({ "sizeLogs": pm.logsSize(), "sizeUploads": pm.uploadsSize(), "driveTotal": driveTotal, "driveUsed": driveUsed, "driveFree": driveFree, "clearFiles": clearFiles })
def updateSoftwareVersion(): if request.method == 'DELETE': softwareManager.resetUpdate() return jsonify() else: data = request.get_json() total, used, free = platformManager().driveStats() if free > 1073741824: # 1 GB if 'release_ids' in data: if softwareManager.updateSoftware(data['release_ids']): return jsonify() else: return ("Unable to update", 500) else: return ("Invalid data", 400) else: return ("Not enough space", 507)