File: __init__.py

package info (click to toggle)
python-pyramid 1.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,528 kB
  • ctags: 6,601
  • sloc: python: 35,136; makefile: 38
file content (30 lines) | stat: -rw-r--r-- 838 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from pyramid.view import notfound_view_config, view_config
from pyramid.response import Response

@notfound_view_config(route_name='foo', append_slash=True)
def foo_notfound(request): # pragma: no cover
    return Response('foo_notfound')

@notfound_view_config(route_name='baz')
def baz_notfound(request):
    return Response('baz_notfound')

@notfound_view_config(append_slash=True)
def notfound(request):
    return Response('generic_notfound')

@view_config(route_name='bar')
def bar(request):
    return Response('OK bar')

@view_config(route_name='foo2')
def foo2(request):
    return Response('OK foo2')

def includeme(config):
    config.add_route('foo', '/foo')
    config.add_route('foo2', '/foo/')
    config.add_route('bar', '/bar/')
    config.add_route('baz', '/baz')
    config.scan('pyramid.tests.pkgs.notfoundview')