changeset 3:4dcb932065e4

finish dispatching version of webob_view
author k0s <k0scist@gmail.com>
date Thu, 29 Oct 2009 15:28:52 -0400
parents 4ebaf68f2272
children ee9ed5875df0
files setup.py webob_view/template/+package+/dispatcher.py webob_view/template/+package+/handlers.py
diffstat 3 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Thu Oct 29 15:11:05 2009 -0400
+++ b/setup.py	Thu Oct 29 15:28:52 2009 -0400
@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 import sys, os
 
-version = ''
+version = '0.5'
 
 setup(name='webob_view',
       version=version,
@@ -12,13 +12,12 @@
       keywords='',
       author='Jeff Hammel',
       author_email='jhammel@openplans.org',
-      url='http://www.openplans.org/people/k0s',
+      url='http://k0s.org',
       license='GPL',
       packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
       include_package_data=True,
       zip_safe=False,
-      install_requires=[ 'PasteScript',
-      ],
+      install_requires=[ 'PasteScript' ],
       entry_points="""
       # -*- Entry points: -*-
       [paste.paster_create_template]
--- a/webob_view/template/+package+/dispatcher.py	Thu Oct 29 15:11:05 2009 -0400
+++ b/webob_view/template/+package+/dispatcher.py	Thu Oct 29 15:28:52 2009 -0400
@@ -22,5 +22,7 @@
             if h.match(request):
                 handler = h(request)
                 break
+        else:
+            handler = exc.HTTPNotFound
         res = handler()
         return res(environ, start_response)
--- a/webob_view/template/+package+/handlers.py	Thu Oct 29 15:11:05 2009 -0400
+++ b/webob_view/template/+package+/handlers.py	Thu Oct 29 15:28:52 2009 -0400
@@ -30,7 +30,7 @@
     def __call__(self):
         name = self.request.GET.get('name', 'world')
         retval = """<html><body><form method="post">Hello,
-<input type="text" value="name"/></form></body></html>""" 
+<input type="text" value="%s"/></form></body></html>""" 
         return Response(content_type='text/html', 
                         body=retval % name)
 
@@ -41,7 +41,7 @@
         return request.method == 'POST'
 
     def __call__(self):
-        name = 'foo' # XXX get from self.request.POST
+        name = self.request.POST.get('name', 'world')
         name = escape(name)
         self.redirect(self.link('/?name=%s' % name))