10 XMLRPC_ENDPOINT = 'http://iron-blogger.mako.cc/xmlrpc.php'
22 today = str(datetime.date.today())
24 with open('ledger', 'a') as f:
26 f.write(render.render_template('templates/ledger', date))
28 subprocess.check_call(["git", "commit", "ledger",
29 "-m", "Update for %s" % (date,)])
31 debts = render.get_debts()
34 with open('ledger', 'a') as f:
36 for (user, debt) in debts:
37 if debt < 30: continue
41 Pool:Owed:%(user)s $-%(debt)s
43 """ % {'user': user, 'debt': debt, 'today': today})
47 text = render.render_template('templates/week.tmpl', date, punt=punt)
49 lines = text.split("\n")
51 body = "\n".join(lines[1:])
53 page = dict(title = title, description = body)
56 subprocess.call(['stty', '-echo'])
57 passwd = raw_input("Password for %s: " % (USER,))
60 subprocess.call(['stty', 'echo'])
62 x = xmlrpclib.ServerProxy(XMLRPC_ENDPOINT)
63 x.metaWeblog.newPost(BLOG_ID, USER, passwd, page, True)
65 email = render.render_template('templates/email.txt', date, punt=punt)
70 p = subprocess.Popen(['mutt', '-H', '/dev/stdin'],
71 stdin=subprocess.PIPE)
75 with open('bloggers.yml') as b:
76 bloggers = yaml.safe_load(b)
78 if 'end' not in bloggers[p]:
79 bloggers[p]['end'] = today
80 with open('bloggers.yml','w') as b:
81 yaml.safe_dump(bloggers, b)
83 subprocess.check_call(["git", "commit", "ledger", "bloggers.yml",
84 "-m", "Punts for %s" % (today,)])