beer/beer.py
kleph 543b9c7260
Some checks failed
continuous-integration/drone/push Build is failing
Configure time with URL
2020-02-20 02:23:04 +01:00

31 lines
659 B
Python
Executable file

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