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)
def deleteTask(task_id): if request.method == 'DELETE': r = renderDataHolder() result = r.deleteTask(task_id) return jsonify({'result': result})
def getTasks(): if request.method == 'GET': r = renderDataHolder() all_tasks = r.getAllTasks() return jsonify({'all_tasks': all_tasks})
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
def scanTasks(): if request.method == 'GET': r = renderDataHolder() result = r.scanShotgunFolders() return jsonify({'shotgunFoldersScan': result})