>>> import albatross >>> class Ctx(albatross.SimpleContext): ... def input_add(self, *args): ... print args ... >>> ctx = Ctx('.') >>> ctx.locals.zero = 0 >>> ctx.locals.zerostr = '0' >>> ctx.locals.width = 5 >>> ctx.locals.height = 7 >>> ctx.locals.secret = 42 >>> ctx.locals.other_secret = '<"&' >>> albatross.Template(ctx, '', ''' ... ... ... ... ... ... ... ... ... ''').to_html(ctx) ('text', 'zero', 0, False) ('text', 'zerostr', '0', False) ('text', 'width', 5, False) ('text', 'area', 35, False) ('password', 'passwd', None, False) ('submit', 'login', 'Login', False) ('hidden', 'secret', 42, False) ('hidden', 'other_secret', '<"&', False) >>> ctx.flush_content()