annotate theslasher/factory.py @ 0:3812c1493dde default tip

add the slasher...be afraid, be very afraid
author k0s <k0scist@gmail.com>
date Mon, 11 Jan 2010 17:50:36 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3812c1493dde add the slasher...be afraid, be very afraid
k0s <k0scist@gmail.com>
parents:
diff changeset
1 from paste.httpexceptions import HTTPExceptionHandler
3812c1493dde add the slasher...be afraid, be very afraid
k0s <k0scist@gmail.com>
parents:
diff changeset
2 from theslasher import TheSlasher
3812c1493dde add the slasher...be afraid, be very afraid
k0s <k0scist@gmail.com>
parents:
diff changeset
3 from webob import Response
3812c1493dde add the slasher...be afraid, be very afraid
k0s <k0scist@gmail.com>
parents:
diff changeset
4
3812c1493dde add the slasher...be afraid, be very afraid
k0s <k0scist@gmail.com>
parents:
diff changeset
5 def example(environ, start_response):
3812c1493dde add the slasher...be afraid, be very afraid
k0s <k0scist@gmail.com>
parents:
diff changeset
6 return Response(content_type='text/plain', body=environ['PATH_INFO'])(environ, start_response)
3812c1493dde add the slasher...be afraid, be very afraid
k0s <k0scist@gmail.com>
parents:
diff changeset
7
3812c1493dde add the slasher...be afraid, be very afraid
k0s <k0scist@gmail.com>
parents:
diff changeset
8 def factory(global_conf, **app_conf):
3812c1493dde add the slasher...be afraid, be very afraid
k0s <k0scist@gmail.com>
parents:
diff changeset
9 """create a webob view and wrap it in middleware"""
3812c1493dde add the slasher...be afraid, be very afraid
k0s <k0scist@gmail.com>
parents:
diff changeset
10 return TheSlasher(example)
3812c1493dde add the slasher...be afraid, be very afraid
k0s <k0scist@gmail.com>
parents:
diff changeset
11