It should be:
$for line in lines:
$ csv = line.rstrip().split(",")
(notice the space before csv.)
In 0.3, the correct way to use globals is this:
globals = {'time': time}
render = web.template.render('templates', globals=globals)
See http://webpy.org/docs/0.3/templetor for more details.