## -*- coding: utf-8 -*- From: ${mail} Content-Type: text/plain; charset=utf-8 Subject: IRON BLOGGER results for the week beginning ${week_start.strftime("%F")} To: ${mail} SLACKERS: <% lame=0 %> % for u in sorted(userlist, key=lambda u:u.name[u.name.rfind(' '):].lower()): % for b in u.lameblogs: <% lame+=1 %> - ${u.name} in ${b} % endfor % endfor % if punt: PUNTED for balance ≥$30: ${", ".join(sorted(punt))} % endif People who posted: % for u in sorted(userlist, key=lambda u:u.name[u.name.rfind(' '):].lower()): % for b in u.goodblogs: <% pc=0 %> ${u.name} in ${b} (${u.username}): % for p in u.posts[b][week]: % if pc < 10: <% pc+=1 %> - ${p['url']} % endif % endfor % if len(u.posts[b][week]) > 10: (and ${len(u.posts[b][week])-10} more) % endif % endfor % endfor % if skip: People who have not yet started: % for u in sorted(skip, key=lambda u:u.username): ${u.username} % endfor % endif % if skipped_users: People who are currently skipped: % for u in sorted(skipped_users, key=lambda u:u.username): ${u.username} % endfor % endif Beer pool: This Week: € ${5 * lame} Total: € ${pool} Paid: € ${paid} Events: € ${event} Individual debts: % for (u, v) in sorted(debts, key=lambda p:p[1], reverse=True): ${"%20s %d \u20AC" % (u, v)} % endfor PREVIOUSLY PUNTED (pay € 30 balance to return): % for (u) in sorted(punted, key=lambda p:p.username): ${"%20s (%s)" % (u.username, u.end)} % endfor