Mercurial > hg > contenttransformer
annotate contenttransformer/factory.py @ 8:805cadc2b825
adding example html files for upcoming Genshi transformer
author | k0s <k0scist@gmail.com> |
---|---|
date | Sun, 07 Feb 2010 18:52:40 -0500 |
parents | aa491070ccf3 |
children |
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 |