From 03009f4109a94c74d1dccab0b14b4e4f00f43205 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 28 Sep 2019 15:47:01 -0400 Subject: nfsw/io.py: Add intro. * nfsw/io.py (intro): New function. --- nfsw/io.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nfsw/io.py b/nfsw/io.py index 7d4c600..bc3ab20 100644 --- a/nfsw/io.py +++ b/nfsw/io.py @@ -5,6 +5,7 @@ import nfsw.scenes as scenes from nfsw.auth import login_required, login_required_ajax from nfsw.redis import redis as r, key as k from nfsw.scenes import current_scene +from nfsw.util import read_junk from flask import ( Blueprint, render_template, request @@ -56,3 +57,18 @@ def query(): } +@bp.route('/io/intro', methods=['POST']) +@login_required_ajax +@preprocess +def intro(): + + # Get current scene + scene = current_scene() + if scene is None: + return { + 'intro': read_junk('foobar/god') + }, 500 + + return { + 'intro': scene({'intro': 1}) + } -- cgit v1.2.3