def save_xml_scene(scene_id=None): try: scene = scene_gateway.get_by(scene_id) except SceneNotFoundException: scene = SceneStruct() scene.storage_xml = request.data scene_gateway.save(scene) return Response(json.dumps({'scene_id': scene.scene_id}), content_type='application/json')
def save_python_scene(scene_id): scene = scene_gateway.get_by(scene_id) scene.script_python = request.data scene_gateway.save(scene) return Response()
def clone_scene(scene_id): scene = scene_gateway.get_by(scene_id) scene.scene_id = None scene_gateway.save(scene) return redirect(url_for('web.list_scenes'))
def load_xml_scene(scene_id): scene = scene_gateway.get_by(scene_id) return Response(scene.storage_xml, content_type='text/xml')
def edit_scene(scene_id): scene = scene_gateway.get_by(scene_id) return render_template('scenes/edit.html', scene=scene)