示例#1
0
def getLogSoftwareSettings():
    s = settings()
    pm = platformManager()

    #Get files in the logs directory

    return jsonify(serialActivated=s.getBoolean(['serial', 'log']),
                   files=pm.listLogs())
示例#2
0
    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)
示例#3
0
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)
示例#4
0
    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
        })
示例#5
0
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)