Improve styling on week.tmpl
[iron-blogger] / weekly-update.py
index c513a14478f2103c698052e7e2585ea6db774e7f..dd217ce8b32114dc29e67373ee8543d3b78da91c 100755 (executable)
@@ -18,6 +18,13 @@ finally:
 
 x = xmlrpclib.ServerProxy(XMLRPC_ENDPOINT)
 
+with open('ledger', 'a') as f:
+    f.write("\n")
+    f.write(render.render_template('templates/ledger', sys.argv[1]))
+
+subprocess.check_call(["git", "commit", "ledger",
+                       "-m", "Update for %s" % (sys.argv[1],)])
+
 text = render.render_template('templates/week.tmpl', sys.argv[1])
 
 lines = text.split("\n")
@@ -28,3 +35,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?