From ab393a07f5f2381803b1ecb8fc15a66451f910b7 Mon Sep 17 00:00:00 2001 From: Nelson Elhage Date: Mon, 1 Mar 2010 19:50:54 -0500 Subject: [PATCH] Do the ledger and email in weekly-update. --- weekly-update.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/weekly-update.py b/weekly-update.py index c513a14..faa6c4c 100755 --- a/weekly-update.py +++ b/weekly-update.py @@ -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])) -- 2.39.5