X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=calories.py;h=5d2fc98c3aaf99ceaeae0708e6f06094370c8bc3;hb=f659ede27c7fd6313e0bfaa8217a3359c00d5843;hp=5f710878460e2cd4a11599eb9850f89f60e7d117;hpb=f60cdbddc6395eef3c5ebb69fbbb35797dd76532;p=misc diff --git a/calories.py b/calories.py index 5f71087..5d2fc98 100644 --- a/calories.py +++ b/calories.py @@ -10,12 +10,10 @@ def build_page(eatable_rows, consumption_rows, eatables_selection, day_rows): return """ """ + f"""
@@ -28,8 +26,8 @@ td, th { + - @@ -45,9 +43,9 @@ td, th { - - - + + + @@ -280,9 +278,9 @@ class MyServer(BaseHTTPRequestHandler): eatables += ""\ ""\ ""\ - ""\ - ""\ - ""\ + ""\ + ""\ + ""\ ""\ ""\ "" % (k, v.title, v.cals, v.sugar_g, v.standard_g, v.comments, k) @@ -292,27 +290,27 @@ class MyServer(BaseHTTPRequestHandler): r = db.calc_consumption(c) consumptions += ""\ ""\ + ""\ "%s"\ - ""\ ""\ - "%.1f"\ - "%.1f"\ - "" % (c.eatable_key, db.eatables[c.eatable_key].title, c.unit_count, r["cals"], r["sugar"]) + "%.1f"\ + "%.1f"\ + "" % (c.eatable_key, c.unit_count, db.eatables[c.eatable_key].title, r["cals"], r["sugar"]) day_rows = "" for date in sorted(db.days.keys()): day = db.days[date] day_rows = ""\ "%s"\ - "%.1f"\ - "%.1f"\ + "%.1f"\ + "%.1f"\ "" % (date, date[:10], day.calories, day.calories, day.sugar_g, day.sugar_g) + day_rows day_rows = ""\ "today:archive?"\ ""\ ""\ ""\ - "%.1f"\ - "%.1f"\ + "%.1f"\ + "%.1f"\ ""\ "" % (db.today_date, db.today.calories, db.today.calories, db.today.sugar_g, db.today.sugar_g) + day_rows page = build_page(eatables, consumptions, db.eatables_selection(), day_rows)