From 8145bb217fffc640060c05c4a52fd25baca84994 Mon Sep 17 00:00:00 2001 From: vitrinekast Date: Tue, 26 Mar 2024 22:28:23 +0100 Subject: [PATCH] use fallback --- script.py | 5 +++-- templates/book.jinja | 21 +++++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/script.py b/script.py index bf6d0c1..21d7356 100644 --- a/script.py +++ b/script.py @@ -67,13 +67,14 @@ env = Environment(loader=FileSystemLoader("/home/xpub/www/html/tl-dr/templates") # loading the template (use template.jinja when generating the html webview) template = env.get_template("book.jinja") - +fallback = list_package_installs # rendering the template and storing the resultant text in variable output output = template.render( now = now.strftime("%B %dth %Y"), last_user_added=last_user_added.stdout.decode('UTF-8'), last_user_added_name=last_user_added_name, - users_created_today=users_created_today, + # users_created_today=users_created_today, + users_created_today=fallback, since_last_boot=since_last_boot, list_package_installs=list_package_installs, list_package_upgrade=list_package_upgrade, diff --git a/templates/book.jinja b/templates/book.jinja index 9b56887..1411d52 100644 --- a/templates/book.jinja +++ b/templates/book.jinja @@ -18,6 +18,7 @@ + A log book of {{now}} @@ -137,18 +138,18 @@ user_deleted : {{ user_deleted }} {% endif %} {% if list_package_installs|length > 0 %} -

tldr@chopchop:~ $ grep 'install' /var/log/dpkg.log

+

tldr@chopchop:~ $ grep 'install' /var/log/dpkg.log

- - Today the following packages were installed: - + + Today the following packages were installed: + - {{ log_output(list_package_installs) }} - - Packages are often installed to use different software or coding languages or build alternative tools. Often - users have to talk about and consider which packages they need and why, as well as how much storage they take up - and how they will change their interactions with and on their shared server. - + {{ log_output(list_package_installs) }} + + Packages are often installed to use different software or coding languages or build alternative tools. Often + users have to talk about and consider which packages they need and why, as well as how much storage they take up + and how they will change their interactions with and on their shared server. + {% endif %} {% if list_package_installs|length < 0 %} Today no new packages were installed...