-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
35 lines (29 loc) · 1.13 KB
/
main.py
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
from flask import Flask, render_template
from app.playerinfo import Player
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/<string:userid>/')
def userinfo(userid):
player = Player(userid)
isvalid = player.isvalid()
personaname = player.personaname()
avatarfull = player.avatarfull()
profileurl = player.profileurl()
plus = player.plus()
rank = player.rank()
winrate = player.winrate()
win = player.win()
lose = player.lose()
loccountrycode = player.loccountrycode()
wordcloud = player.wordcloudinfo()
listheroes = player.listheroes()
heroid = player.heroid()
matches = player.last_matches()
if isvalid:
return render_template('userinfo.html', matches=matches, isvalid=isvalid, heroid=heroid,listheroes=listheroes, wordcloud=wordcloud, loccountrycode=loccountrycode, win=win, lose=lose, winrate=winrate, rank=rank, plus=plus, profileurl=profileurl, userid=userid, personaname=personaname, avatarfull=avatarfull)
else:
return render_template('notfound.html')
if __name__ == '__main__':
app.run(debug=True)