X-Git-Url: https://projects.mako.cc/source/iron-blogger/blobdiff_plain/81e81fc0096b9eb93ed3dd1f65df5308d0fef610..f7cc6eaa8d3e23957e01cf93d1265f368434d34a:/render.py diff --git a/render.py b/render.py index 0e320bf..9e1fbdc 100755 --- a/render.py +++ b/render.py @@ -9,7 +9,7 @@ import os.path import subprocess from mako.template import Template -START = datetime.datetime(2009, 12, 21, 6) +START = datetime.datetime(2011, 10, 24, 6) HERE = os.path.dirname(__file__) def get_balance(acct): @@ -73,6 +73,7 @@ def render_template(path, week=None, **kwargs): lame = [] skip = [] userlist = [] + punted = [] class User(object): pass @@ -88,10 +89,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) @@ -113,7 +119,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: