diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..5f4eba6 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/RPi.py b/RPi.py new file mode 100644 index 0000000..d85f1fa --- /dev/null +++ b/RPi.py @@ -0,0 +1,4 @@ +class GPIO: + + def output(a,b): + pass \ No newline at end of file diff --git a/app.py b/app.py index fe6ee9e..6d67311 100644 --- a/app.py +++ b/app.py @@ -74,8 +74,8 @@ bar.drinks[3].create_version(shortname='single', ingredients=[bar.ingredients[5], bar.ingredients[6]], proportions=[30,70], glassize=200) bar.save_config('config') - ''' + '''BARTENDER2 SECTION END''' bar = reload_config('config') @@ -349,19 +349,27 @@ def submitDeleteVersion(): @app.route("/swapping") def swapView(toast=""): + if request.method == 'GET': + toast = request.args.get('toast') return render_template('/swapping.html', toast=toast, ingredients=bar.ingredients) -@app.route("/tools/swap", methods=['POST']) +@app.route("/tools/swap", methods=['GET','POST']) def swapAction(): try: - iding = request.form.get('iding') + iding = ""; + if request.method == 'POST': + iding = request.form.get('iding') + else: + iding = request.args.get('iding') if iding == "": raise Exception() + iding = int(iding) bar.ingredients[iding].swapBottle() bar.save_config('config') + return redirect(url_for('swapView', toast='Bottle refilled.')) return swapView('Bottle refilled.') except: return swapView('Something went wrong..') @@ -414,6 +422,7 @@ def startChrome(): driver.get("http://127.0.0.1:5000") if __name__ == "__main__": - t = Thread(target=startChrome + t = Thread(target=startChrome) t.start() app.run(debug=False) + #app.run(host='192.168.0.77', port=5000, debug=False) diff --git a/bar.py b/bar.py index f596a98..4c9c167 100644 --- a/bar.py +++ b/bar.py @@ -1,6 +1,7 @@ import time import sys -import RPi.GPIO as GPIO +#import RPi.GPIO as GPIO +from RPi import GPIO import json from threading import Thread import traceback diff --git a/config/config.obj b/config/config.obj new file mode 100644 index 0000000..eaeec98 Binary files /dev/null and b/config/config.obj differ diff --git a/static/pictures/munichmule.png b/static/pictures/munichmule.png new file mode 100644 index 0000000..d133d1c Binary files /dev/null and b/static/pictures/munichmule.png differ diff --git a/static/pictures/wodkacola.png b/static/pictures/wodkacola.png new file mode 100644 index 0000000..d5b1343 Binary files /dev/null and b/static/pictures/wodkacola.png differ diff --git a/templates/swapping.html b/templates/swapping.html index 21fac02..6ab89aa 100644 --- a/templates/swapping.html +++ b/templates/swapping.html @@ -2,9 +2,9 @@ {% block content %} -
+
-
+
{#

Swap bottle

@@ -25,9 +25,45 @@

Swap bottle

- +#}
+ + +
+ + + {% for ingredient in ingredients %} + + {% endfor %} {% endblock content%} @@ -35,8 +71,11 @@

Swap bottle