From: Benjamin Mako Hill Date: Mon, 9 Jul 2012 11:50:49 +0000 (+0200) Subject: added code to list folks who have previously been punted to the weekly update X-Git-Url: https://projects.mako.cc/source/iron-blogger/commitdiff_plain/ccea18de09f4e3a4221cdd14f0d3d18ce812c37a added code to list folks who have previously been punted to the weekly update --- diff --git a/render.py b/render.py index 6e4e80c..8425d92 100755 --- a/render.py +++ b/render.py @@ -75,6 +75,7 @@ def render_template(path, week=None, **kwargs): lame = [] skip = [] userlist = [] + punted = [] class User(object): pass @@ -90,10 +91,15 @@ def render_template(path, week=None, **kwargs): userlist.append(u) + # create a subset of punted users + if u.end: + punted.append(u) + def user_key(u): return (u.start, u.username) userlist.sort(key=user_key) + punted.sort(key=user_key) for u in userlist: user_start = parse(u.start, default=START) @@ -115,7 +121,7 @@ def render_template(path, week=None, **kwargs): week=week, week_start=week_start,week_end=week_end, good=good, lame=lame, skip=skip, userlist=userlist, pool=get_balance('Pool'), paid=get_balance('Pool:Paid'), - debts=debts, **kwargs) + debts=debts, punted=punted, **kwargs) if __name__ == '__main__': if len(sys.argv) < 2: diff --git a/templates/email.txt b/templates/email.txt index 59d64e8..667eaef 100644 --- a/templates/email.txt +++ b/templates/email.txt @@ -31,3 +31,8 @@ Individual debts: % for (u, v) in sorted(debts, key=lambda p:p[1], reverse=True): ${"%20s $%d" % (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 diff --git a/templates/week.tmpl b/templates/week.tmpl index 0672bf4..4df9ca6 100644 --- a/templates/week.tmpl +++ b/templates/week.tmpl @@ -62,3 +62,10 @@ Results for week beginning ${week_start.strftime("%F")} %endif + +

Previously Punted (pay $30 to return):

+ \ No newline at end of file