Browse Source

Graphe également présent pour les ban

master
guimoz 9 years ago
parent
commit
774f0ff1e1
  1. 24
      roulette.py

24
roulette.py

@ -296,10 +296,31 @@ def banned():
else:
explanation = u'Tu t\'es tranché toi-même, pas de chance...'
#Calcul des statistiques
con = connect_sqlite()
cur = con.cursor()
cur.execute("""select firstname,name,ban_end from players""")
rows = cur.fetchall()
con.close()
tranchés = 0
n_tranchés = 0
with open(IMMUNITY_FILE, 'r') as f:
immunity = f.read()
for row in rows:
if row[0]+' '+row[1] not in immunity:
if row[2] > time():
tranchés += 1
else:
n_tranchés += 1
stats = (tranchés,n_tranchés)
timeleft = int(player['ban_end'] - time())
return render_template('banned.html', \
explanation=explanation, timeleft=timeleft)
explanation=explanation, timeleft=timeleft, stats=stats)
@app.route('/banned_ip')
@ -367,6 +388,7 @@ def home():
bans_hist.append(entry)
#Calcul des statistiques
con = connect_sqlite()
cur = con.cursor()

Loading…
Cancel
Save