From 2b17ed3b444e7169ce9910422ecb9b8ab02141ae Mon Sep 17 00:00:00 2001 From: "user@node5.net" Date: Mon, 6 Jul 2026 15:52:31 +0200 Subject: fix: default parameter for width --- src/text_tv.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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/') -@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/') +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/') 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/") def text(width: int) -> dict[str, str]: return {part: eval(part)(width=width) for part in ['top', 'program']} -- cgit v1.3.1