Example #1
0
def installTask():
    data = request.json
    file = data.get('file', None)
    if file:
        atm = additionalTasksManager()
        if atm.installFile(file):
            return jsonify()
        else:
            return make_response('Unable to Install', 500)

    return make_response('Invalid Request', 400)
Example #2
0
def additionalTasksCreate():
    if not "file" in request.files.keys():
        return make_response("No file included", 400)

    file = request.files["file"]

    atm = additionalTasksManager()
    r = atm.checkTaskFile(file)

    if 'error' in r:
        return make_response(r['error'], 500)
    else:
        return jsonify(r)
Example #3
0
def deleteTask():
    data = request.json
    tId = data.get('id', None)

    if tId:
        atm = additionalTasksManager()
        r = atm.removeTask(tId)

        if 'error' in r:
            error = r['error']

            if error == 'not_found':
                return make_response('Not Found', 404)
            else:
                return make_response(error, 500)

        else:
            return jsonify(r)

    return make_response('Invalid Request', 400)
Example #4
0
 def additionalTasks(self, data, sendMessage):
     sendMessage(additionalTasksManager().data)
Example #5
0
def additionalTasks():
    return jsonify(additionalTasksManager().data)