vendor/tramline

view src/tramline/progress.py @ 12:c77f592b081f

Simple handler to request progress info
author gracinet
date Sun, 22 Feb 2009 20:30:22 +0000
parents
children 60db9e957c02
line source
1 from mod_python import apache
2 from tramline.core import get_progress
4 def handler(req):
5 progress_id = req.uri.rsplit('/', 1)[-1]
6 uploaded = get_progress(req, progress_id)
7 if uploaded is None:
8 req.status = apache.HTTP_NOT_FOUND
9 else:
10 req.write(str(uploaded))
11 req.content_type = "text/plain"
12 return apache.OK