annotate contenttransformer/factory.py @ 25:2a2063d571a6 default tip

py3
author Jeff Hammel <k0scist@gmail.com>
date Mon, 28 Dec 2020 20:42:56 +0000
parents aa491070ccf3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
aa491070ccf3 now works, just doesnt do anything, i dont think
k0s <k0scist@gmail.com>
parents: 0
diff changeset
1 from web import Dispatcher
0
29805d442afc initial commit of contenttransformer; still in the stub stage
k0s <k0scist@gmail.com>
parents:
diff changeset
2 from paste.httpexceptions import HTTPExceptionHandler
29805d442afc initial commit of contenttransformer; still in the stub stage
k0s <k0scist@gmail.com>
parents:
diff changeset
3
29805d442afc initial commit of contenttransformer; still in the stub stage
k0s <k0scist@gmail.com>
parents:
diff changeset
4 def factory(global_conf, **app_conf):
29805d442afc initial commit of contenttransformer; still in the stub stage
k0s <k0scist@gmail.com>
parents:
diff changeset
5 """create a webob view and wrap it in middleware"""
1
aa491070ccf3 now works, just doesnt do anything, i dont think
k0s <k0scist@gmail.com>
parents: 0
diff changeset
6 keystr = 'transformer.'
0
29805d442afc initial commit of contenttransformer; still in the stub stage
k0s <k0scist@gmail.com>
parents:
diff changeset
7 args = dict([(key.split(keystr, 1)[-1], value)
29805d442afc initial commit of contenttransformer; still in the stub stage
k0s <k0scist@gmail.com>
parents:
diff changeset
8 for key, value in app_conf.items()
29805d442afc initial commit of contenttransformer; still in the stub stage
k0s <k0scist@gmail.com>
parents:
diff changeset
9 if key.startswith(keystr) ])
29805d442afc initial commit of contenttransformer; still in the stub stage
k0s <k0scist@gmail.com>
parents:
diff changeset
10 app = Dispatcher(**args)
29805d442afc initial commit of contenttransformer; still in the stub stage
k0s <k0scist@gmail.com>
parents:
diff changeset
11 return HTTPExceptionHandler(app)
29805d442afc initial commit of contenttransformer; still in the stub stage
k0s <k0scist@gmail.com>
parents:
diff changeset
12