Mercurial > mozilla > hg > dogfood
changeset 1:2cb8b06d64df
minor fixes
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 10 Oct 2012 16:23:02 -0700 |
parents | b3fd8f98df32 |
children | e0ea3f0b407a |
files | dogdish/dispatcher.py |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/dogdish/dispatcher.py Wed Oct 10 16:01:56 2012 -0700 +++ b/dogdish/dispatcher.py Wed Oct 10 16:23:02 2012 -0700 @@ -1,5 +1,7 @@ +#!/usr/bin/env python + """ -request dispatcher +dogdish """ from webob import Request, exc @@ -9,6 +11,7 @@ from webob import Response, exc class Handler(object): + def __init__(self, request): self.request = request self.application_path = urlparse(request.application_url)[2] @@ -41,11 +44,8 @@ return request.method == 'GET' def __call__(self): - name = self.request.GET.get('name', 'world') - retval = """<html><body><form method="post">Hello, -<input type="text" name="name" value="%s"/></form></body></html>""" - return Response(content_type='text/html', - body=retval % name) + return Response(content_type='text/xml', + self.body) class Dispatcher(object):