Esempio n. 1
0
def readStatus(task_id):
    if request.method == 'GET':
        r = renderDataHolder()
        status = r.getValue(task_id, 'status')
        output = r.getValue(task_id, 'output')
        if status or output:
            try:
                output_data = file(output).read()
            except:
                output_data = output
            return jsonify({'status': status, 'output': output_data})
        else:
            abort(404)
Esempio n. 2
0
def deleteTask(task_id):
    if request.method == 'DELETE':
        r = renderDataHolder()
        result = r.deleteTask(task_id)
        return jsonify({'result': result})
Esempio n. 3
0
def getTasks():
    if request.method == 'GET':
        r = renderDataHolder()
        all_tasks = r.getAllTasks()
        return jsonify({'all_tasks': all_tasks})
Esempio n. 4
0
def addTask():
    if request.method == 'POST':
        r = renderDataHolder()
        task_id = r.addNewTask(request.json.get('scene_path'), request.json.get('sequence_path'))
        return jsonify({'id': task_id}), 201
Esempio n. 5
0
def scanTasks():
    if request.method == 'GET':
        r = renderDataHolder()
        result = r.scanShotgunFolders()
        return jsonify({'shotgunFoldersScan': result})