#!/usr/bin/env python """ homepage.py - Juno Homepage Module Copyright 2008, Sean B. Palmer, inamidst.com Licensed under the Eiffel Forum License 2. http://inamidst.com/whits/code/juno/ """ import cgitb cgitb.enable() import itertools from entries import entries def main(options): print 'Content-Type: text/html; charset=utf-8' print output = True for uri, updated, title, content in itertools.islice(entries(), 10): u = updated[:10] + ' ' + updated[11:16] + ' UTC' if output: print options['head'].replace('$updated', u) output = False entry = options['entry'] entry = entry.replace('$uri', uri) entry = entry.replace('$updated', u) entry = entry.replace('$title', title) entry = entry.replace('$content', content) print entry print options['tail'] if __name__ == '__main__': print __doc__