From b170121643bf03743a77d4f5946e9554415b61df Mon Sep 17 00:00:00 2001 From: Davide Bongiovanni Date: Wed, 2 Nov 2016 10:52:54 +0100 Subject: [PATCH] Added code skeleton for opening fridge and tools --- server.py | 16 ++++++---------- server.pyc | Bin 4055 -> 3936 bytes templates/status.html | 4 ++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/server.py b/server.py index 9106408..31661a6 100644 --- a/server.py +++ b/server.py @@ -1,6 +1,6 @@ from functools import wraps from flask import Flask -from flask import render_template, send_from_directory, request, Response +from flask import render_template, send_from_directory, request, Response, redirect, url_for import json, time app = Flask(__name__) @@ -25,18 +25,14 @@ def index(): @app.route('/status') @requires_auth -def somehtml(): +def status(): return render_template('status.html') -@app.route('/users') +@app.route('/open/') @requires_auth -def users(): - return 'This button is actually useless.' - -@app.route('/history') -@requires_auth -def history(): - return render_template('history.html') +def users(what): + print 'opened', what + return redirect(url_for('status')) @app.route('/gethistory') @requires_auth diff --git a/server.pyc b/server.pyc index 0cfba351c51a2baf7f727a23cfbad1e92f77cf40..7752a691c66973294766be541c975c1c794ed7a6 100644 GIT binary patch delta 804 zcmYjOy>HV{5Wi<9jvd>H<0MT&QCfitCIjI^tq?*L;zP~E;4H|C74jZxtEP$U7aL0)cBQq-_3wKrwv3e2Ch zh>{M@H=isfCPXGoEQl;%9Do<#qzq9RR=N$54MGRuz&i$!3%m$t08s_FkttQ+rA+Za zxNuwpZc-$-$Vn-F?k|%mJmB_9Lafli8KuX^pq;~r!#TdfAH#XB=^UZ zMnZq-F-qD&;0zAl0vrq^fW+NuG!TBnfWn?hs!c@%4_l}PR6HbSNUdkBSh9dB-Jxz9 zd#X~ZnB)N6V(M$@6WdY3ykNa$&w8q{uA12|j4smQw)$c3IN1sgk5V~JUMtNxX1A6T z=N@BC_1XP%b%=p!o2s!Y+eL9%YYppK&`}qa`=fsyg*T}59zwS0I6fUsL>x<+W;C0H z*?wJ$X;4fNA(_sl2sg+_BZjoZ@G`*`!Cit!>YK5zK2&SHYiN4RV>elwIhv*8Yqbjw K^GS+p=as+u34$;H delta 754 zcmZ9K%Wl(95Qb;s_!c{kb599{H0mW(C_xoSz@i`o5<;v@CBOnjX??1+a+)f37F~4# zD>i`6Bd}x{@dmsDTUP9=iWM7XtXNpsI=}y!Z_XThDXnH`J*BmjuGTZS z0YQU9zsVzc(QC>vZed=2!l#Q16gjs*WAh9alf{yU`Hyv%ZJDG;3wp?*D<5cs#Xa>7 zcDX#7PQ*B#gjd+-NI;1+(!o3uvq-*G*ETy8?v0P4&i*`(rzah9ql0)p3d6GwRfQso z`aO`hv|V{qcdE-K+fAKom<>B&?{snKyU;20KFTNU2 za@dv^g?+6}CEluhZEdJtlf3+39pmlAZ|g2%RrZU2@TJ^#*03d?JNMsga`g^L%&##V zo{T19IE?xK8l9ec$*?T0sc?--GMmn0;ng@-XKAqTLEZ|>Rh9wEZt|fUrE-6pLKj`^ VVhin@snBh<@-|lfUn=Fge*y43h2H=G diff --git a/templates/status.html b/templates/status.html index 0959042..54ac81d 100644 --- a/templates/status.html +++ b/templates/status.html @@ -20,9 +20,9 @@

Card access manager


-
Open fridge
+
Open fridge

-
Open tools
+
Open tools