Do the ledger and email in weekly-update.
authorNelson Elhage <nelhage@mit.edu>
Tue, 2 Mar 2010 00:50:54 +0000 (19:50 -0500)
committerNelson Elhage <nelhage@mit.edu>
Tue, 2 Mar 2010 00:50:54 +0000 (19:50 -0500)
weekly-update.py

index c513a14478f2103c698052e7e2585ea6db774e7f..faa6c4cc42dd53f478398c2a126d7f09fc75957d 100755 (executable)
@@ -18,6 +18,9 @@ finally:
 
 x = xmlrpclib.ServerProxy(XMLRPC_ENDPOINT)
 
+with open('ledger', 'a') as f:
+    f.write(render.render_template('templates/ledger', sys.argv[1]))
+
 text = render.render_template('templates/week.tmpl', sys.argv[1])
 
 lines = text.split("\n")
@@ -28,3 +31,7 @@ page = dict(title = title,
             description = body)
 
 x.metaWeblog.newPost(BLOG_ID, USER, passwd, page, True)
+
+p = subprocess.Popen(['mutt', '-H', '/dev/stdin'],
+                     stdin=subprocess.PIPE)
+p.communicate(render.render_template('templates/email.txt', sys.argv[1]))

Benjamin Mako Hill || Want to submit a patch?