#!/usr/bin/python
import time
from albatross import SimpleContext

class SlowProcess:
    def __getitem__(self, i):
        time.sleep(1)
        if i < 10:
            return i
        raise IndexError

ctx = SimpleContext('.')
templ = ctx.load_template('stream.html')
ctx.locals.process = SlowProcess()

print 'Content-Type: text/html'
print
templ.to_html(ctx)
ctx.flush_content()
