]> projects.mako.cc - iron-blogger/commitdiff
added code to list folks who have previously been punted to the weekly update
authorBenjamin Mako Hill <mako@atdot.cc>
Mon, 9 Jul 2012 11:50:49 +0000 (13:50 +0200)
committerBenjamin Mako Hill <mako@atdot.cc>
Mon, 9 Jul 2012 11:50:49 +0000 (13:50 +0200)
render.py
templates/email.txt
templates/week.tmpl

index 6e4e80ce53e708b007b00f656a9526ebda1333d2..8425d925b45ba1baec9977eaf3760dad83ab0bc6 100755 (executable)
--- a/render.py
+++ b/render.py
@@ -75,6 +75,7 @@ def render_template(path, week=None, **kwargs):
     lame = []
     skip = []
     userlist = []
     lame = []
     skip = []
     userlist = []
+    punted = []
 
     class User(object):
         pass
 
     class User(object):
         pass
@@ -90,10 +91,15 @@ def render_template(path, week=None, **kwargs):
 
         userlist.append(u)
 
 
         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)
     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)
 
     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'),
         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:
 
 if __name__ == '__main__':
     if len(sys.argv) < 2:
index 59d64e8fb4954736cfc78bf860d0d799a9beb18b..667eaef7a86da25b45cb320dfb46a2a3a522bc5d 100644 (file)
@@ -31,3 +31,8 @@ Individual debts:
 % for (u, v) in sorted(debts, key=lambda p:p[1], reverse=True):
 ${"%20s $%d" % (u, v)}
 % endfor
 % 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
index 0672bf4c5157555174fb9dd44bcd7833e77561af..4df9ca6756bf7b330418483fb017d5d5bb3219ad 100644 (file)
@@ -62,3 +62,10 @@ Results for week beginning ${week_start.strftime("%F")}
 </tr>
 %endif
 </table>
 </tr>
 %endif
 </table>
+
+<h2>Previously Punted (pay $30 to return):</h2>
+<ul>
+% for (u) in sorted(punted, key=lambda p:p.username):
+<li>${u.username} (${u.end})</li>
+% endfor
+</ul>
\ No newline at end of file

Benjamin Mako Hill || Want to submit a patch?