]> projects.mako.cc - iron-blogger/blobdiff - render.py
Revert "update render.py to work with new options in ledger >=3"
[iron-blogger] / render.py
index 0e320bf5afb2d995a49f6429f73bc5a816cd4ed5..9e1fbdc48b422609ebd4c574decf5fecd046a7ce 100755 (executable)
--- 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:

Benjamin Mako Hill || Want to submit a patch?