summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/text_tv.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/text_tv.py b/src/text_tv.py
index abd86e2..af7d744 100644
--- a/src/text_tv.py
+++ b/src/text_tv.py
@@ -12,9 +12,8 @@ app = flask.Flask(__name__, template_folder='templates', static_folder='static',
debug = 'PROD' not in os.environ
-@app.route('/top', defaults={'width': 34})
+@app.route('/top', defaults={'width': 50})
@app.route('/top/<width>')
-@app.route('/top')
def top(width: int):
now = datetime.datetime.now() if not program_parser.override_date else program_parser.override_date
parts = ['BornHack', 'S105', now.strftime("%a %d %b"), now.strftime("%R:%S")]
@@ -26,12 +25,13 @@ def top(width: int):
top = top + " " * remainder
return top
-@app.route('/update')
-def update():
- return top() + '\n' + flask.render_template('program.html', parts=text())
+@app.route('/update', defaults={'width': 50})
+@app.route('/update/<width>')
+def update(width: int):
+ return top(width=width) + '\n' + flask.render_template('program.html', parts=text(width=width))
-@app.route('/program.json', defaults={'width': 34})
+@app.route('/program.json', defaults={'width': 50})
@app.route('/program.json/<width>')
def program(width: int):
title_max_length = width - 17 # Truncate the title minus the length of the date, icon and associated whitespace
@@ -41,7 +41,7 @@ def program(width: int):
return events_to_show
-@app.route("/text/", defaults={'width': 34})
+@app.route("/text/", defaults={'width': 50})
@app.route("/text/<width>")
def text(width: int) -> dict[str, str]:
return {part: eval(part)(width=width) for part in ['top', 'program']}