2020-02-14 00:58:44 +01:00
|
|
|
#!/usr/bin/env python3.6
|
|
|
|
# -*- coding:utf-8 -*-
|
2020-02-14 01:06:37 +01:00
|
|
|
""" stupid countdown beer app to amuse my colleagues and collect buzzwords """
|
2020-02-14 00:58:44 +01:00
|
|
|
|
|
|
|
from flask import Flask
|
2020-02-20 02:23:04 +01:00
|
|
|
from flask import render_template
|
2020-02-14 01:06:37 +01:00
|
|
|
|
|
|
|
# pylint: disable=invalid-name
|
2020-02-14 00:58:44 +01:00
|
|
|
app = Flask(__name__)
|
|
|
|
|
2020-02-14 01:06:37 +01:00
|
|
|
|
2020-02-14 00:58:44 +01:00
|
|
|
@app.route('/')
|
2020-02-20 02:23:04 +01:00
|
|
|
@app.route('/<int(min=0, max=23):hours>/<int(min=0, max=59):minutes>')
|
|
|
|
def index(hours=None, minutes=None):
|
2020-02-14 01:06:37 +01:00
|
|
|
""" main and only app """
|
2020-02-20 02:23:04 +01:00
|
|
|
if not hours:
|
|
|
|
hours = 17
|
|
|
|
if not minutes:
|
|
|
|
minutes = 0
|
|
|
|
|
|
|
|
data = render_template('beer.html', hours=hours, minutes=minutes)
|
|
|
|
return data
|
2020-02-14 00:58:44 +01:00
|
|
|
|
|
|
|
|
2020-02-14 01:06:37 +01:00
|
|
|
def main():
|
|
|
|
""" main func """
|
|
|
|
app.run(host='::')
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|