1
0
mirror of https://github.com/Adam-Ant/ClockworkAprilFools2017 synced 2024-12-20 11:04:35 +00:00

Format webinterface.py

This commit is contained in:
Joe Groocock 2017-03-31 21:11:09 +01:00
parent e5f3d7c829
commit e41e5c48e8
Signed by untrusted user: frebib
GPG Key ID: E0B16BEACFBB6A86

View File

@ -5,11 +5,10 @@ import ts3
pp = pprint.PrettyPrinter(indent=4)
app = Flask(__name__)
app.secret_key = rand(24)
def teamspeakClientAdd(clientName):
with ts3.query.TS3Connection('magic.adam-ant.co.uk', '10011') as ts3conn:
try:
@ -33,6 +32,7 @@ def teamspeakClientAdd(clientName):
except:
print("ERROR")
def teamspeakClientCheck(clientName):
with ts3.query.TS3Connection('magic.adam-ant.co.uk', '10011') as ts3conn:
try:
@ -70,6 +70,7 @@ def index():
session.pop('username', None)
return render_template("index.html")
@app.route("/collectsunlight")
def wait():
if "username" in session:
@ -77,6 +78,7 @@ def wait():
else:
return redirect(url_for("buy"))
@app.route("/pay")
def payment():
if "username" in session:
@ -84,6 +86,7 @@ def payment():
else:
return redirect(url_for("buy"))
@app.route("/activate")
def activate():
if "username" in session:
@ -104,6 +107,6 @@ def buy():
return teamspeakClientCheck(session['username'])
return render_template("buy.html")
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True)