forked from Glaceon31/LLhelper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
135 lines (102 loc) · 3.36 KB
/
app.py
File metadata and controls
135 lines (102 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# -*- coding: utf-8 -*-
#import sae.kvdb
#from sae.storage import Bucket
from flask import Flask, render_template, redirect, session, request, send_file
import string
import random
import json
from lldata import LLData
app = Flask(__name__)
app.secret_key = "hatsune miku"
app.debug = True
g_llcarddata = LLData()
g_llcarddata.loadJson('newcardsjson.txt')
### activity ###
@app.route("/activitypt")
def activitypt():
return render_template("activitypt.html")
@app.route("/llactivity", methods=['GET', 'POST'])
def llactivity():
return render_template('llactivity.html')
@app.route("/llrally", methods=['GET', 'POST'])
def llrally():
return render_template('llrally.html')
@app.route("/smmulti")
def smmulti():
return render_template("smmulti.html")
@app.route("/llsm", methods=['GET', 'POST'])
def llsm():
return render_template('llscorematch.html')
@app.route("/llmf", methods=['GET', 'POST'])
def llmf():
return render_template('llmedleyfestival.html')
@app.route("/llcf", methods=['GET', 'POST'])
def llcf():
return render_template('llchallengefestival.html')
@app.route("/llnm", methods=['GET', 'POST'])
def llnm():
return render_template('llnakayoshi.html')
@app.route("/mfpt", methods=['GET', 'POST'])
def mfpt():
return render_template('mfpt.html')
@app.route("/cfpt", methods=['GET', 'POST'])
def cfpt():
return render_template('cfpt.html')
@app.route("/nmpt", methods=['GET', 'POST'])
def nmpt():
return render_template('nmpt.html')
### data ###
@app.route("/llsongdata")
def llsongdata():
songsjson = open('newsongsjson.txt', 'rb').read()
return render_template('llsongdata.html', songsjson = songsjson)
@app.route("/llcoverage")
def llcoverage():
cardsjson = open('newcardsjson.txt', 'rb').read()
return render_template('llcoverage.html', cardsjson = cardsjson)
@app.route("/llnewcarddata")
def llnewcarddata():
cardsjson = open('newcardsjson.txt', 'rb').read()
return render_template('llnewcarddata.html', cardsjson = cardsjson)
@app.route("/llurcardrank")
def llurcardrank():
cardsjson = open('newcardsjson.txt', 'rb').read()
return render_template('llurcardrank.html', cardsjson = cardsjson)
@app.route("/lldata/cardbrief", methods=['GET'])
def lldata_cardbrief():
return json.dumps(g_llcarddata.queryByKeys(request.args['keys']))
@app.route("/lldata/card/<index>", methods=['GET'])
def lldata_carddetail(index):
return json.dumps(g_llcarddata.queryByIndex(index))
### data api ###
@app.route("/llcardapiwiki")
def llcardapi():
return open("cardsjson.txt").read()
@app.route("/llmapapiwiki")
def llmapapi():
return open("songsjson.txt").read()
@app.route("/document")
def document():
return send_file("document.txt")
### species ###
@app.route("/llspecies", methods=['GET', 'POST'])
@app.route("/llurrank", methods=['GET', 'POST'])
def urrank():
return render_template("llurrank.html")
### level up ###
@app.route("/lllvlup", methods=['GET', 'POST'])
def lllvlup():
return render_template("lllvlup.html")
### mainpage ###
@app.route("/", methods=['GET', 'POST'])
def hello():
return render_template('mainpage.html')
@app.route("/about")
def about():
return render_template('about.html')
from legacy_app import legacy_app
app.register_blueprint(legacy_app, url_prefix="/legacy")
from llunit import *
from lldatamodify import *
if __name__ == "__main__":
app.run()