]> projects.mako.cc - iron-blogger/blob - generate-page.py
Move build products into out/
[iron-blogger] / generate-page.py
1 import yaml
2 from mako.template import Template
3
4 with open('bloggers.yml') as f:
5     users = yaml.safe_load(f.read())
6
7 class User(object):
8     pass
9
10 all = []
11 for (un, rec) in users.items():
12     u = User()
13     u.username = un
14     u.links = rec['links']
15     u.start = rec['start']
16     all.append(u)
17
18 def user_key(u):
19     return (u.start, u.username)
20
21 all.sort(key=user_key)
22
23 tmpl = Template(filename='templates/iron-blogger.tmpl', output_encoding='utf-8')
24 print tmpl.render(users=all)

Benjamin Mako Hill || Want to submit a patch?