]> projects.mako.cc - iron-blogger/blobdiff - render.py
Update for last week
[iron-blogger] / render.py
index 478c44cd3af3b590121d46d404ee430ed1197194..8cda0d52b3808d8bead38e3229242d17b9ca3632 100755 (executable)
--- a/render.py
+++ b/render.py
@@ -40,6 +40,9 @@ def render_template(path, week=None):
         u.username = un
         u.links = rec['links']
         u.start = rec['start']
+        u.end   = rec.get('end')
+        u.skip  = [(parse(x, default=START) - START).days / 7
+                   for x in rec.get('skip', [])]
         u.weeks = report.get(un, [])
 
         userlist.append(u)
@@ -51,7 +54,12 @@ def render_template(path, week=None):
 
     for u in userlist:
         user_start = parse(u.start, default=START)
-        if user_start > week_start:
+        if u.end and parse(u.end, default=START) <= week_start:
+            continue
+
+        if week in u.skip:
+            pass
+        elif user_start > week_start:
             skip.append(u)
         elif len(u.weeks) <= week or not u.weeks[week]:
             lame.append(u)

Benjamin Mako Hill || Want to submit a patch?